adding lifecycle hook for test exit

This commit is contained in:
josebarn
2017-08-16 09:08:13 -03:00
parent c9978db11a
commit 78d1b044e9
3 changed files with 38 additions and 7 deletions

View File

@@ -28,7 +28,9 @@ func addMiddleware(mux *chi.Mux) {
func addRoutes(mux *chi.Mux) {
// Add a simple resource
mux.Mount("/api/id", AppResource{}.Routes())
mux.Mount("/api/id", AppResource{}.Routes())
// lifecycle management hooks
mux.Mount("/.service", AppLifecycleResource{}.Routes())
// Live a healthy life!
mux.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("yolo"))