Eunsu486

Modify app.js

Showing 1 changed file with 6 additions and 0 deletions
...@@ -6,8 +6,11 @@ var logger = require('morgan'); ...@@ -6,8 +6,11 @@ var logger = require('morgan');
6 6
7 var indexRouter = require('./routes/index'); 7 var indexRouter = require('./routes/index');
8 var usersRouter = require('./routes/users'); 8 var usersRouter = require('./routes/users');
9 +var categoryRouter = require('./routes/category');
10 +var vendorRounter = require('./routes/vendors');
9 11
10 var app = express(); 12 var app = express();
13 +var bodyParser = require('body-parser');
11 14
12 // view engine setup 15 // view engine setup
13 app.set('views', path.join(__dirname, 'views')); 16 app.set('views', path.join(__dirname, 'views'));
...@@ -26,6 +29,9 @@ app.use('/users', usersRouter); ...@@ -26,6 +29,9 @@ app.use('/users', usersRouter);
26 app.use(function (req, res, next) { 29 app.use(function (req, res, next) {
27 next(createError(404)); 30 next(createError(404));
28 }); 31 });
32 +app.use('/category', categoryRouter);
33 +app.use('/vendors/bootstrap', express.static(path.join(__dirname, "./node_modules/bootstrap/dist")));
34 +app.use(bodyParser.urlencoded({ extended: false }));
29 35
30 // error handler 36 // error handler
31 app.use(function (err, req, res, next) { 37 app.use(function (err, req, res, next) {
......