DWork Web
Project Overview
DWork Web is an experimental web framework designed for simplicity and flexibility.
Project Documentation
You can find the documentation for this project in English
or Portuguese
.
Creating Your First Website
To create your first website using DWork Web, follow these steps:
-
Installation: Integrate DWork into your project using the following command in the terminal:
go get github.com/Diegiwg/dwork-web
-
Import DWork Web Package: Import the DWork Web package into your Go project:
package main
import (
dworkweb "github.com/Diegiwg/dwork-web/dw"
)
-
Create App Object: In the main
function, create an app
object using the MakeApp
method:
func main() {
app := dworkweb.MakeApp()
}
-
Add Routes: Add routes to your website using methods like GET
, POST
, PUT
, or DELETE
on the app
object. For example, to set up a GET route at /
:
app.GET("/", func(ctx dworkweb.Context) {
content := `<h1>Your First Page with DWork Web (GO + HTML)</h1>`
ctx.Response.Html(content)
})
-
Start Server: Start the server using the Serve
method:
app.Serve(":8080")
Now you can access http://localhost:8080/ and view your first page.
For a complete example, refer to the basic-site
directory.
Examples of Use
You can find more examples of how to use DWork Web in the example
directory.
Contributing
Contributions to DWork Web are highly encouraged and greatly appreciated. Whether you wish to report issues, suggest improvements, or submit pull requests, your contributions are invaluable in enhancing this project.
Changelog
For details about the latest changes, updates, and version history, please refer to the changelog
file.
License
This project is licensed under the MIT License. For comprehensive details, please review the license
file.