Guest User

Untitled

a guest
Nov 17th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. var express = require('express');
  2. var config = require('./modules/config');
  3. var routes = require('./modules/routes'); // Using all routes as an exported function. See routes.js.
  4. var db = require('./modules/db.js');
  5.  
  6. var app = express();
  7. app.set('view engine', 'pug');
  8.  
  9. app.use('/form', express.static(`${__dirname}/static`));
  10. app.use('/form/form', express.static(`${__dirname}/static`));
  11. // app.use('/static', express.static(`${__dirname}/static`));
  12. app.use('/uploads', express.static(`${__dirname}/uploads`));
  13.  
  14.  
  15. routes(app, config, db); // Running routes module with the app, config and database objects. Webroutes are found in routes.js.
  16.  
  17. db.sql.sync().then(function(){
  18.  
  19. app.listen(config.port, function(){
  20.  
  21. console.log(`Express running on ${config.port}`);
  22.  
  23. });
  24.  
  25. });
Add Comment
Please, Sign In to add comment