Moves static into webapp
This commit is contained in:
@@ -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)
|
||||
})))
|
||||
|
||||
Reference in New Issue
Block a user