Commit 5358142a authored by Mike Shoup's avatar Mike Shoup

Add golang app

parent f79e471b
package main
import (
type Message struct {
Hello string `json:"hello"`
func GetHelloHandler(w http.ResponseWriter, r *http.Request) {
m := &Message{Hello: "world"}
j, _ := json.Marshal(m)
w.Header().Set("Content-Type", "application/json")
func main() {
r := mux.NewRouter()
r.HandleFunc("/hello", GetHelloHandler).Methods("GET")
http.Handle("/", r)
log.Fatal(http.ListenAndServe(":8000", nil))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment