Skip to content

Instantly share code, notes, and snippets.

@gagan-bansal

gagan-bansal/app.js

Created Sep 9, 2013
Embed
What would you like to do?
sample express with browserify-middleware app.js
var browserify = require('browserify-middleware');
var express = require('express');
var app = express();
browserify.settings.development('basedir', __dirname);
app.use('/js',browserify('./client'));
app.get('/js/main.js', browserify('./client/main.js',{
external: ['OpenLayers'],
detectGlobals: false
}));
app.get('/js/OpenLayers.js',browserify(['OpenLayers'], {
noParse: ['OpenLayer'],
cache: true,
debug: false
}));
app.use(express.static(__dirname + '/public'));
app.listen(3000);
console.log("server listening at: 3000");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment