Configure Spring Boot for SPA frontend

For routing, according to this guide at Using “Natural” Routes (specifically here), you have to add a controller that does the following: @Controller public class RouteController { @RequestMapping(value = “/{path:[^\\.]*}”) public String redirect() { return “forward:/”; } } Then using Spring Boot, the index.html loads at /, and resources can be loaded; routes are handled … Read more

creating tasks using a loop [gulp]

Another option is to use functional array looping functions combined with Object.keys, like so: var defaultTasks = Object.keys(jsFiles); defaultTasks.forEach(function(taskName) { gulp.task(taskName, function() { return gulp.src(jsFiles[taskName]) .pipe(jshint()) .pipe(uglify()) .pipe(concat(key + ‘.js’)) .pipe(gulp.dest(‘public/js’)); }); }); I feel like this is a little cleaner, because you have the loop and the function in the same place, so it’s … Read more

npm install not work

It looks like you are behind a proxy. To by pass it, you have to configure it like : npm config set proxy http://myproxyblabla:myport npm config set https-proxy http://myproxyblabla:myport Problems with https are solved with : npm config set registry http://registry.npmjs.org/

Using Gulp to Concatenate and Uglify files

It turns out that I needed to use gulp-rename and also output the concatenated file first before ‘uglification’. Here’s the code: var gulp = require(‘gulp’), gp_concat = require(‘gulp-concat’), gp_rename = require(‘gulp-rename’), gp_uglify = require(‘gulp-uglify’); gulp.task(‘js-fef’, function(){ return gulp.src([‘file1.js’, ‘file2.js’, ‘file3.js’]) .pipe(gp_concat(‘concat.js’)) .pipe(gulp.dest(‘dist’)) .pipe(gp_rename(‘uglify.js’)) .pipe(gp_uglify()) .pipe(gulp.dest(‘dist’)); }); gulp.task(‘default’, [‘js-fef’], function(){}); Coming from grunt it was a … Read more