How to do livereload on a local server?

0

In recent times I have seen a lot of information about Gulp.js for front-end development. And I want to use some functions of it like livereload while developing the front end of a java application. But I can not find information about making the gulp run together with another external local server that has communication with the database.

Does anyone know if it is possible, and what is the best way to make gulp.js work with applications like this?

    
asked by anonymous 06.10.2015 / 19:04

1 answer

-1

I do not know if I understood the question well, but you can use the Browser Sync plugin to create the local server that will serve your front-end files with support for livereload.

To install:

link

npm install browser-sync --save

Configuring in Gulp:

link

var gulp        = require('gulp');
var browserSync = require('browser-sync').create();

// Static server
gulp.task('browser-sync', function() {
    browserSync.init({
        server: {
            baseDir: "./"
        }
    });
});

To run the gulp along with your application, one way is to configure your IDE, in the project settings I believe it is possible to perform a bash command that will initialize the gulp and its tasks.

    
29.03.2016 / 01:03