-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcrashbloxServer.js
40 lines (30 loc) · 1.13 KB
/
crashbloxServer.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
const express = require('express');
const app = express();
const cors = require('cors');
var path = require('path')
const configData = require('./config.json');
app.use(cors());
app.use(express.static(path.join(__dirname, 'Public/Static')));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'Public/index.html'))
})
app.get('/landing.html', (req, res) => {
res.sendFile(path.join(__dirname, 'Public/landing.html'))
})
app.get('/blog.html', (req, res) => {
res.sendFile(path.join(__dirname, 'Public/blog.html'))
})
app.get('/developers.html', (req, res) => {
res.sendFile(path.join(__dirname, 'Public/developers.html'))
})
app.get('/crashtodon.html', (req, res) => {
res.sendFile(path.join(__dirname, 'Public/crashtodon.html'))
})
app.get('/game.html', (req, res) => {
res.sendFile(path.join(__dirname, 'Public/game.html'))
})
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*")
next()
})
app.listen(configData.crashbloxServerPort, configData.hostAddress, () => console.log('WebGL Server is listening on port: ' + configData.crashbloxServerPort));