-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
37 lines (28 loc) · 914 Bytes
/
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
35
36
37
/*
* index.js
* --------
* This is the main server file of the TextForSale application.
* The package.json file targets this file with the command "npm start"
* to bootstrap the application. It loads the application's dependencies
* and listens locally on port 31337.
*
*/
// Invoke 'strict' Javascript mode
'use strict';
// Set environment
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
// Load the application dependencies
const express = require('./config/express'),
mongoose = require('./config/mongoose');
// Instantiate the database
const db = mongoose();
// Instantiate the application
const app = express(db);
// Instantiate "passport" middleware
const passport = require('./config/passport')();
// Listen on specified port
app.listen(31337);
// Log status
console.log('Application running on http://localhost:31337');
// Export the application
module.exports = app;