github.com/mattevans/edward@v1.9.2/examples/watches/service1/main.go (about)

     1  // A simple executable that stays runnning until an interrupt is received
     2  // Based on: https://gobyexample.com/signals
     3  package main
     4  
     5  import (
     6  	"fmt"
     7  	"net/http"
     8  )
     9  
    10  func handler(w http.ResponseWriter, r *http.Request) {
    11  	fmt.Fprintf(w, "This is service1 at: %s!", r.URL.Path[1:])
    12  }
    13  
    14  func main() {
    15  	http.HandleFunc("/", handler)
    16  	fmt.Println("Starting to listen on port 8080")
    17  	http.ListenAndServe(":8080", nil)
    18  }