Skip to content

Instantly share code, notes, and snippets.

@dlorenc
Created March 23, 2019 22:05
Show Gist options
  • Save dlorenc/f9154c95fff62a9fc9bba653eae025dc to your computer and use it in GitHub Desktop.
Save dlorenc/f9154c95fff62a9fc9bba653eae025dc to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"log"
"net/http"
"./backend"
)
func main() {
backend.Initialize()
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
log.Println(r.URL.Path)
fmt.Fprintf(w, "OK")
})
// http.HandleFunc("/api", func(w http.ResponseWriter, r *http.Request) {
// log.Println(r.URL.Path)
// fmt.Fprintf(w, "APIOK")
// })
// http.HandleFunc("/api/", func(w http.ResponseWriter, r *http.Request) {
// log.Println(r.URL.Path)
// fmt.Fprintf(w, "APIOK")
// })
// http.HandleFunc("/api/pixels", backend.Pixels)
// http.HandleFunc("/api/pixels/", backend.Pixels)
log.Fatal(http.ListenAndServe(":8081", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment