-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (28 loc) · 1.07 KB
/
index.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
27
28
29
30
31
32
33
34
// Load dependencies
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const morgan = require('morgan'); // Morgan Freeman? Is that you?
const passport = require('passport');
const authenticationConfig = require('./config/authentication');
// Create an express app
const app = express();
// Activate and use all of the middleware
app.use(morgan('tiny')); // Senpai Morgan Freeman?
app.use(cors());
app.use(bodyParser.json()); // I'm Jason. I'm in a fridge.
// Configure and initialize Passport.
authenticationConfig(passport);
app.use(passport.initialize());
// Projects router
app.use('/projects', require('./routes/projects'));
app.use('/auth', require('./routes/auth'));
app.use('/users', require('./routes/users'));
app.use('/elements', require('./routes/elements'));
app.use('/tasks', require('./routes/tasks'));
// What port will we run on?
const port = process.env.PORT || 3000;
// Start Cassian up.
app.listen(port, () => {
console.log("Time to kick ass and chew paperclips. And I'm all out of paperclips.");
});