Moves static into webapp
This commit is contained in:
@@ -16,5 +16,5 @@ gulp.task('test', function() {
|
||||
|
||||
|
||||
gulp.task('autotest', function() {
|
||||
return gulp.watch(['static/js/**/*.js','test/specs/*.js'], ['test']);
|
||||
return gulp.watch(['webapp/js/**/*.js','test/specs/*.js'], ['test']);
|
||||
});
|
||||
|
||||
@@ -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)
|
||||
})))
|
||||
|
||||
@@ -2,10 +2,10 @@ module.exports = function(config) {
|
||||
config.set({
|
||||
basepath: './',
|
||||
files : [
|
||||
'static/bower_components/angular/angular.js',
|
||||
'static/bower_components/angular-route/angular-route.js',
|
||||
'static/bower_components/angular-mocks/angular-mocks.js',
|
||||
'static/js/**/*.js',
|
||||
'webapp/bower_components/angular/angular.js',
|
||||
'webapp/bower_components/angular-route/angular-route.js',
|
||||
'webapp/bower_components/angular-mocks/angular-mocks.js',
|
||||
'webapp/js/**/*.js',
|
||||
'test/specs/**/*.js'
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user