DWork Web is an experimental web framework designed for simplicity and flexibility.
You can find the documentation for this project in English
or Portuguese
.
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 anapp
object using theMakeApp
method:func main() { app := dworkweb.MakeApp() }
-
Add Routes: Add routes to your website using methods like
GET
,POST
,PUT
, orDELETE
on theapp
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.
You can find more examples of how to use DWork Web in the example
directory.
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.
For details about the latest changes, updates, and version history, please refer to the changelog
file.
This project is licensed under the MIT License. For comprehensive details, please review the license
file.