Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var app = express.createServer();
- // get the dir from the command line
- const DIR = process.argv[2] || __dirname;
- // a little bit of configuration...
- app.configure(function() {
- app.use(express.methodOverride());
- app.use(express.bodyParser());
- app.use(app.router);
- });
- app.configure('development', function () {
- app.use(express.static(DIR));
- app.use(express.errorHandler({
- dumpExceptions: true,
- showStack: true
- }));
- });
- // start the server
- app.listen(80);
- console.log('Server startup, with basedir "' + DIR + '".');
Add Comment
Please, Sign In to add comment