Skip to content

DWork Web is a lightweight web framework for Go, designed to simplify web application development.

License

Notifications You must be signed in to change notification settings

Diegiwg/dwork-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  1. Installation: Integrate DWork into your project using the following command in the terminal:

    go get github.com/Diegiwg/dwork-web
  2. Import DWork Web Package: Import the DWork Web package into your Go project:

    package main
    
    import (
        dworkweb "github.com/Diegiwg/dwork-web/dw"
    )
  3. Create App Object: In the main function, create an app object using the MakeApp method:

    func main() {
        app := dworkweb.MakeApp()
    }
  4. 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)
    })
  5. 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.