Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created September 25, 2022 15:03
Show Gist options
  • Save percybolmer/42b5a50028eca9d0200d1e7e5c942474 to your computer and use it in GitHub Desktop.
Save percybolmer/42b5a50028eca9d0200d1e7e5c942474 to your computer and use it in GitHub Desktop.
func main() {
// Create a root ctx and a CancelFunc which can be used to cancel retentionMap goroutine
rootCtx := context.Background()
ctx, cancel := context.WithCancel(rootCtx)
defer cancel()
setupAPI(ctx)
// Serve on port :8080, fudge yeah hardcoded port
err := http.ListenAndServeTLS(":8080", "server.crt", "server.key", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment