forked from TrP-Labs/trptools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (27 loc) · 1.11 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
/*
TrP Tools is an unofficial open source web service which aims to provide easy to use tools to the TrP community
Copyright (C) 2024 TickoGrey
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const express = require('express');
const app = express();
const path = require('path');
const http = require('http').createServer(app);
var cookieParser = require('cookie-parser')
require('dotenv').config();
app.use(cookieParser())
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'Content'), {
extensions: ['html'],
}));
// Require module systems
app.use('/proxy', require(__dirname + '/serverModules/proxy.js'));
app.use('/auth', require(__dirname + '/serverModules/auth.js'));
app.use('/articles', require(__dirname + '/serverModules/articles.js'));
const socketIO = require(__dirname + '/serverModules/dispatchSocket.js');
socketIO(http);
// 404 Handler - This must come last
app.use(function(req, res) {
res.status(404).sendFile(__dirname + '/Content/404.html');
});
http.listen(process.env.PORT);