Created
February 2, 2014 17:34
-
-
Save prabirshrestha/8771852 to your computer and use it in GitHub Desktop.
This file contains 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 characters
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