-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·51 lines (38 loc) · 1.19 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
const express = require("express");
const cors = require('cors');
const fs = require("fs");
var app = express();
var bodyParser = require('body-parser');
var private = require(process.argv[3] || './private');
var port = process.argv[2] || 8080;
app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.text({ limit: '50mb' }));
app.use(express.static('polymorph'));
app.listen(port);
app.use(cors());
/*try {
var app2 = express();
app2.get("*", (req, res) => res.send(`<script>window.location.href="http://localhost:8080"</script>`));
app2.listen(80);
} catch (e) {
}*/
var saveloader = require("./saveload");
saveloader.prepare(app, private);
//var gitlite = require("./gitlite");
//gitlite.prepare(app, private);
if (private.imageFileLocation) { // dont want this on the linode
var imageServer = require("./imageServer");
imageServer.prepare(app, private);
}
if (private.lobbyFileLocation) {
var lobby = require("./lobby");
lobby.prepare(app, private);
}
if (private.baseGitLocation) {
var glob = require("./hilagit");
glob.prepare(app, private);
}
if (private.baseMonoGitLocation) {
var monogit = require("./monogit");
monogit.prepare(app, private);
}