Contains the Concourse pipeline definition for building a line-server container
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 lines
699 B

9 years ago
9 years ago
9 years ago
9 years ago
  1. package main
  2. import (
  3. "net/http"
  4. "github.com/flosch/pongo2"
  5. "github.com/zenazn/goji/web"
  6. )
  7. func indexHandler(c web.C, w http.ResponseWriter, r *http.Request) {
  8. err := Templates["index.html"].ExecuteWriter(pongo2.Context{}, w)
  9. if err != nil {
  10. http.Error(w, err.Error(), http.StatusInternalServerError)
  11. }
  12. }
  13. func notFoundHandler(c web.C, w http.ResponseWriter, r *http.Request) {
  14. w.WriteHeader(404)
  15. err := Templates["404.html"].ExecuteWriter(pongo2.Context{}, w)
  16. if err != nil {
  17. oopsHandler(c, w, r)
  18. }
  19. }
  20. func oopsHandler(c web.C, w http.ResponseWriter, r *http.Request) {
  21. err := Templates["oops.html"].ExecuteWriter(pongo2.Context{}, w)
  22. if err != nil {
  23. oopsHandler(c, w, r)
  24. }
  25. }