pehpeh API server in golang
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

main.go 384B

il y a 4 ans
il y a 4 ans
il y a 4 ans
il y a 4 ans
1234567891011121314151617181920212223242526272829
  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. }