Last active
March 13, 2018 09:39
-
-
Save proclaim/7bcb56a0acac797946a85f43fac03076 to your computer and use it in GitHub Desktop.
caddy-reverse-proxy-tutorial-app2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
// handleFoodApi will take care any data related to food | |
func handleFoodApi(w http.ResponseWriter, r *http.Request) { | |
w.Write([]byte(`{"success":true, "data":"SECRET_INGREDIENT"}`)) | |
} | |
func main() { | |
http.HandleFunc("/api/food", handleFoodApi) | |
fmt.Println("ready at localhost:8800/api/food") | |
http.ListenAndServe(":8800", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment