main.go 354 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "fmt"
  4. "net/http"
  5. "os"
  6. "github.com/qor5/docs/docsrc"
  7. )
  8. func main() {
  9. port := os.Getenv("PORT")
  10. if len(port) == 0 {
  11. port = "8800"
  12. }
  13. // @snippet_begin(HelloWorldMainSample)
  14. fmt.Println("Starting docs at :" + port)
  15. err := http.ListenAndServe(":"+port, docsrc.Mux("/"))
  16. if err != nil {
  17. panic(err)
  18. }
  19. // @snippet_end
  20. }