Last active
April 8, 2021 19:43
-
-
Save dennib/6f1f9aa9b59596710f62c1ef22a655f4 to your computer and use it in GitHub Desktop.
Revisions
-
dennib revised this gist
May 9, 2019 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ const express = require('express'); const app = express(); app.use(express.static('public')); app.get('/', function(req, res) { res.send('Hello World!'); }); // Server Listening app.listen(3000, function() { console.log('App listening on port 3000!'); }); -
dennib revised this gist
May 9, 2019 . No changes.There are no files selected for viewing
-
dennib created this gist
May 9, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ const gulp = require('gulp'); const sass = require('gulp-sass'); const browserSync = require('browser-sync'); const nodemon = require('gulp-nodemon'); sass.compiler = require('node-sass'); // Sass compilation gulp.task('sass', function() { return gulp .src('./sass/**/*.scss') .pipe(sass().on('error', sass.logError)) .pipe(gulp.dest('./css')); }); // Sass watching, depending on "sass" task gulp.task('sass:watch', function() { gulp.watch('./sass/**/*.scss', gulp.series('sass')); }); // Nodemon task: // Start nodemon once and execute callback (browser-sync) gulp.task('nodemon', cb => { let started = false; return nodemon({ script: 'server.js' }).on('start', () => { if (!started) { cb(); started = true; } }); }); // BrowserSync task: // calls nodemon tasks and pass itself as callback gulp.task( 'browser-sync', gulp.series('nodemon', () => { browserSync.init(null, { proxy: 'http://localhost:3000', files: ['public/**/*.*'], port: 5000 }); }) ); // Dev Task: // Parallel execution of browser-sync/nodemon // and sass watching gulp.task('default', gulp.parallel('browser-sync', 'sass:watch'));