-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
26 lines (21 loc) · 912 Bytes
/
server.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
require('dotenv').config();
require('./server/db-conn');
const bluebird = require('bluebird');
const bodyParser = require('body-parser');
const express = require('express');
const mongoose = require('mongoose');
const sentry = require('@sentry/node');
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use('/countries/', require('./server/routes/country-routes'));
app.use('/currencies/', require('./server/routes/currency-routes'));
app.use('/application/', require('./server/routes/application-routes'));
mongoose.Promise = bluebird;
app.get('/', (req, res) => {
res.sendFile('index.html', { root: __dirname });
});
sentry.init({ dsn: 'https://[email protected]/1773867' });
const { PORT } = process.env;
// eslint-disable-next-line no-console
app.listen(PORT, () => console.log(`Application started on port ${PORT}`));