summaryrefslogtreecommitdiff
path: root/webserver.js
diff options
context:
space:
mode:
Diffstat (limited to 'webserver.js')
-rwxr-xr-xwebserver.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/webserver.js b/webserver.js
index 5ebdc41..b53d9ab 100755
--- a/webserver.js
+++ b/webserver.js
@@ -1,9 +1,8 @@
#!/usr/bin/env node
const cmn = require("./modules/$common.js");
-const app = require("express")();
+const express = require("express");
const http = require("http");
-const httpServer = http.Server(app);
-const io = require("socket.io")(httpServer);
+const socketio = require("socket.io");
const url = require("url");
const fs = require("fs");
const util = require("util");
@@ -20,6 +19,11 @@ if (process.argv.length > 3) {
const PORT = process.argv.length == 3 ? +process.argv[2] : 80;
+const app = express();
+const httpServer = http.Server(app);
+const io = socketio(httpServer);
+
+
// const reqlogger = new Logger("request_log.txt");
@@ -67,6 +71,8 @@ refreshWhatpulse();
app.use(bodyParser.text());
+app.use(express.static("static"));
+
const module_list = fs.readdirSync("modules").filter(function (f) {
return ["$common.js", ".DS_Store"].indexOf(f) == -1 && f[0] != "$";