jgo

module
v0.0.0-...-2f2839f Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT

README

JGo Web

Overview

  • Simple routing
  • Automatic template rendering based on request path
  • Response object with support for common functionality, e.g.:
    • Getting form and header data
    • Redirects
  • Sessions with validatable tokens
  • Enforceable CSRF tokens
  • WebSockets
  • Example app with:
    • User accounts
    • Shared HTML templates (e.g. header)
    • SQLite database
    • Chatroom

Docs

https://godoc.org/github.com/jchavannes/jgo

Example

package main

import (
    "github.com/jchavannes/jgo/web"
)

func main() {
    server := web.Server{
        Port: 80,
        Routes: []web.Route{{
            Pattern: "/hello",
            Handler: func(r *web.Response) {
                r.Write("world")
            },
        }},
    }
    server.Run()
}

License

See the LICENSE file for license rights and limitations (MIT).

Directories

Path Synopsis
db
Web abstracts http request and response handling.
Web abstracts http request and response handling.

Jump to

Keyboard shortcuts

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