forked from nermineslimane/Node-express-mysql-starterproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
20 lines (19 loc) · 706 Bytes
/
Copy pathserver.js
File metadata and controls
20 lines (19 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require('dotenv').config();
const express = require('express');
//const config = require('./app/config/auth.config');
const db = require('./app/models');
const app = express();
app.use(express.json());
// parse requests of content-type - application/json
app.use(express.json());
// parse requests of content-type - application/x-www-form-urlencoded
app.use(express.urlencoded({ extended: true }));
const httpServer = require('http').createServer(app);
let PORT;
process.env.STATUS === 'production'
? (PORT = process.env.PROD_PORT)
: (PORT = process.env.DEV_PORT);
httpServer.listen(PORT, () => {
console.log(`Server in ${process.env.STATUS} mode, listening on *:${PORT}`);
});
db.sequelize.sync();