pehpeh API server in golang
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

30 行
384B

  1. package main
  2. import (
  3. "net/http"
  4. "git.thevis.us/skepto/env"
  5. "git.thevis.us/skepto/rex"
  6. )
  7. type Server interface {
  8. Run()
  9. Get(pattern string, handler interface{})
  10. ServeHTTP(w http.ResponseWriter, r *http.Request)
  11. }
  12. func main() {
  13. srv := Configure()
  14. srv.Run()
  15. }
  16. func Configure() Server {
  17. env.Set("PORT", 7777)
  18. server := rex.New()
  19. server.Get("/", Index)
  20. return server
  21. }