1 Star 0 Fork 15

北却 / GoCity

forked from Gitee 极速下载 / GoCity 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 754 Bytes
一键复制 编辑 原始数据 按行查看 历史
Rodrigo Brito 提交于 2018-11-02 11:49 . Move UI to front-end branch
package main
import (
"context"
"log"
"net/http"
"github.com/rodrigo-brito/gocity/handle/middlewares"
"github.com/rodrigo-brito/gocity/handle"
"github.com/go-chi/chi"
"github.com/rodrigo-brito/gocity/lib"
)
func main() {
router := chi.NewRouter()
cache := lib.NewCache()
storage, err := lib.NewGCS(context.Background())
if err != nil {
log.Fatal(err)
}
corsMiddleware := middlewares.GetCors("*")
router.Use(corsMiddleware.Handler)
analyzer := handle.AnalyzerHandle{
Cache: cache,
Storage: storage,
}
router.Get("/api", analyzer.Handler)
router.Get("/health", handle.HealthCheck)
log.Println("Server started at http://localhost:4000")
if err := http.ListenAndServe(":4000", router); err != nil {
log.Print(err)
}
}
1
https://gitee.com/bealone/GoCity.git
git@gitee.com:bealone/GoCity.git
bealone
GoCity
GoCity
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891