dwork-web

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MIT

README

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.

Directories

Path Synopsis
dw
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL