looli 萝莉控专属的 web 框架

业余时间搞了个极简主义的 golang web 框架, https://github.com/cssivision/looli , looli => 萝莉,萝莉控专属的 golang 框架。

  • router 支持常用的路由匹配
  • context 各种常用方法的语法糖
  • middleware 级联的中间件,自带 cors, session, csrf 等中间件

自己造轮子,写自己的网站。

package main

import (
    "net/http"
    "github.com/cssivision/looli"
)

func main() {
    router := looli.Default()

    router.Get("/a/:name", func(c *looli.Context) {
        c.Status(200)
        c.String("hello " + c.Param("name") + "!\n")
    })

    http.ListenAndServe(":8080", router)
}