Guest User

Untitled

a guest
Jan 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. var express = require('express');
  2. var app = express.createServer();
  3.  
  4. // get the dir from the command line
  5. const DIR = process.argv[2] || __dirname;
  6.  
  7. // a little bit of configuration...
  8. app.configure(function() {
  9. app.use(express.methodOverride());
  10. app.use(express.bodyParser());
  11. app.use(app.router);
  12. });
  13.  
  14. app.configure('development', function () {
  15. app.use(express.static(DIR));
  16. app.use(express.errorHandler({
  17. dumpExceptions: true,
  18. showStack: true
  19. }));
  20. });
  21.  
  22. // start the server
  23. app.listen(80);
  24. console.log('Server startup, with basedir "' + DIR + '".');
Add Comment
Please, Sign In to add comment