forked from cockroachdb/examples-orms
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
26 lines (21 loc) · 775 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');
var models = require('./models');
var app = express();
// View engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(bodyParser({type: "*/*"}));
app.use('/', require('./routes/index'));
app.use('/customer', require('./routes/customer'));
app.use('/order', require('./routes/order'));
app.use('/product', require('./routes/product'));
// Automatically create database tables for our Sequelize models then start the
// HTTP server.
models.sequelize.sync().then(function() {
app.listen(process.env.PORT || 6543, function () {
console.log("Listening on port " + this.address().port)
});
});
module.exports = app;