Moves static into webapp

This commit is contained in:
2016-02-11 14:54:04 +01:00
parent 15974168f5
commit 143274f369
9 changed files with 8 additions and 8 deletions

View File

@@ -125,17 +125,17 @@ func (a *appData) buildRouter() http.Handler {
dirs := []string{"css", "js", "img", "fonts", "html", "bower_components"}
for _, d := range dirs {
router.ServeFiles(path.Join("/", d, "/*filepath"), http.Dir(filepath.Join("static", d)))
router.ServeFiles(path.Join("/", d, "/*filepath"), http.Dir(filepath.Join("webapp", d)))
}
router.GET("/", narco.EndChain(ch, narco.HandlerFunc(
func(ctx context.Context, w http.ResponseWriter, req *http.Request, _ httprouter.Params) {
f, err := os.Open(filepath.Join("static", "index.html"))
f, err := os.Open(filepath.Join("webapp", "index.html"))
if err != nil {
narco.Error(ctx, w, err, http.StatusInternalServerError)
return
}
defer closeOrPanic(f, filepath.Join("static", "index.html"))
defer closeOrPanic(f, filepath.Join("webapp", "index.html"))
io.Copy(w, f)
})))