-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
71 lines (66 loc) · 2.83 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// App Variables
const express = require('express');
const app = require('express')();
const mongoose = require('mongoose');
const path = require('path');
const session = require('express-session');
const http = require('http').createServer(app);
// App Configuration
require('dotenv').config()
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
app.use(session({secret: process.env.secret, resave: true, saveUninitialized: true}));
app.use(express.static('public'));
app.use('/js', express.static('views/js'));
app.use(express.static(path.join(__dirname, 'public')));
mongoose.connect(process.env.db, {useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false});
// Server Activation
http.listen(process.env.port, function(){
console.log(`listening on port: ${process.env.port}`);
});
// Page Variables
var index = require('./pages/index.js');
var home = require('./pages/home.js');
var login = require('./pages/login.js');
var create = require('./pages/create.js');
var forgot_password = require('./pages/forgot_password.js');
var reset_password = require('./pages/reset_password.js');
var user_confirm = require('./pages/user_confirm.js');
var logout = require('./pages/logout.js');
var profile = require('./pages/profile.js');
var update_profile = require('./pages/update_profile.js');
var email_update = require('./pages/email_update.js');
var add_tag = require('./pages/add_tag.js');
var upload_picture = require('./pages/upload_picture.js');
var notifications = require('./pages/notifications.js');
var search = require('./pages/search.js');
var contacts = require('./pages/contacts.js');
var matched_profile = require('./pages/matched_profile.js');
var chat = require('./pages/chat.js');
var remove_tag = require('./pages/remove_tag.js');
var oops = require('./pages/oops.js');
var live_notifications = require('./pages/live_notifications.js')
/*
* Page Routing
*/
app.use('/', index);
app.use('/home', home);
app.use('/login', login);
app.use('/create', create);
app.use('/chat', chat);
app.use('/forgot_password', forgot_password);
app.use('/contacts', contacts);
app.use('/matched_profile', matched_profile);
app.use('/notifications', notifications);
app.use('/profile', profile);
app.use('/search', search);
app.use('/add_tag', add_tag);
app.use('/logout', logout);
app.use('/update_profile', update_profile);
app.use('/reset_password', reset_password);
app.use('/upload_picture', upload_picture);
app.use('/check/:var_words', email_update); // this is not in use
app.use('/live_notifications', live_notifications);
app.use('/:var_words', user_confirm);
app.use('/remove_tag', remove_tag);
app.use('/oops', oops);