Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Created February 2, 2014 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prabirshrestha/8771852 to your computer and use it in GitHub Desktop.
Save prabirshrestha/8771852 to your computer and use it in GitHub Desktop.
var Hapi = require('hapi'),
server = Hapi.createServer(parseInt(process.env.PORT || 3000), { files: { relativeTo: __dirname } }),
gulp = require('gulp'),
uglify = require('gulp-uglify'),
jshint = require('gulp-jshint'),
browserify = require('gulp-browserify');
gulp.task('scripts', function () {
gulp.src(['client/app.js'])
.pipe(browserify({
debug: true,
transform: ['reactify']
}))
.pipe(jshint())
// .pipe(uglify({ sourceMap: 'app.map.js'}))
.pipe(gulp.dest('public'));
});
gulp.run('scripts');
server.route({ method: 'GET', path: '/{path?}', handler: { directory: { path: './public' } } });
server.start(function (err) {
if(err) throw err;
console.log('sever started at ' + server.info.uri);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment