pehpeh API server in golang
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 line
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. }