From 143274f36977a43c53050ce2819cb804f75bdc63 Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Thu, 11 Feb 2016 14:54:04 +0100 Subject: [PATCH] Moves static into webapp --- gulpfile.js | 2 +- router.go | 6 +++--- test/karma.conf.js | 8 ++++---- {static => webapp}/css/.gitkeep | 0 {static => webapp}/css/satbd.sateliite.bar.css | 0 {static => webapp}/html/.gitkeep | 0 {static => webapp}/index.html | 0 {static => webapp}/js/.gitkeep | 0 {static => webapp}/js/satbd.satellite.bar.js | 0 9 files changed, 8 insertions(+), 8 deletions(-) rename {static => webapp}/css/.gitkeep (100%) rename {static => webapp}/css/satbd.sateliite.bar.css (100%) rename {static => webapp}/html/.gitkeep (100%) rename {static => webapp}/index.html (100%) rename {static => webapp}/js/.gitkeep (100%) rename {static => webapp}/js/satbd.satellite.bar.js (100%) diff --git a/gulpfile.js b/gulpfile.js index 5616ab9..c875899 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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']); }); diff --git a/router.go b/router.go index c03ec26..fc0bc12 100644 --- a/router.go +++ b/router.go @@ -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) }))) diff --git a/test/karma.conf.js b/test/karma.conf.js index 6d59c58..a9976b6 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -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' ], diff --git a/static/css/.gitkeep b/webapp/css/.gitkeep similarity index 100% rename from static/css/.gitkeep rename to webapp/css/.gitkeep diff --git a/static/css/satbd.sateliite.bar.css b/webapp/css/satbd.sateliite.bar.css similarity index 100% rename from static/css/satbd.sateliite.bar.css rename to webapp/css/satbd.sateliite.bar.css diff --git a/static/html/.gitkeep b/webapp/html/.gitkeep similarity index 100% rename from static/html/.gitkeep rename to webapp/html/.gitkeep diff --git a/static/index.html b/webapp/index.html similarity index 100% rename from static/index.html rename to webapp/index.html diff --git a/static/js/.gitkeep b/webapp/js/.gitkeep similarity index 100% rename from static/js/.gitkeep rename to webapp/js/.gitkeep diff --git a/static/js/satbd.satellite.bar.js b/webapp/js/satbd.satellite.bar.js similarity index 100% rename from static/js/satbd.satellite.bar.js rename to webapp/js/satbd.satellite.bar.js