Skip to content

thor-son/doboo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

doboo

go http framework with fasthttp

example

package main

import (
	"fmt"

	"github.com/thor-son/doboo"
	"github.com/valyala/fasthttp"
)

func main() {

	router := doboo.New()

  	router.AddRoute("GET", "/", func(c *doboo.Context) {
		fmt.Fprintf(c, "index page")
	})

	router.AddRoute("GET", "/do/<id>/<action>", func(c *doboo.Context) {
		fmt.Fprintf(c, "id : %s\n", c.GetPathParamValue("id"))
		fmt.Fprintf(c, "action : %s\n", c.GetPathParamValue("action"))
	})

	router.SetNotFoundHandler(func(c *doboo.Context) {
		fmt.Fprintf(c, "not found handler.")
	})

  	fasthttp.ListenAndServe(":8081", router.HandleRequest)
}

About

go http framework with fasthttp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages