-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
36 lines (26 loc) · 752 Bytes
/
server.js
File metadata and controls
36 lines (26 loc) · 752 Bytes
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
27
28
29
30
31
32
33
34
35
36
if (!process.env.PORT) {
require('dotenv').config();
}
// Module Imports
const express = require('express');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
require('./data/db');
// App and Middleware Configuration
const app = express();
// app.use(bodyParser.json());
app.use(express.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cookieParser());
// Routes
const characters = require('./controllers/characters');
characters(app);
const quotes = require('./controllers/quotes');
quotes(app);
const auth = require('./controllers/auth');
auth(app);
// Start the Server
app.listen(3000, () => {
console.log('App listening at http://localhost:3000');
});
module.exports = app;