Separated client files

This commit is contained in:
Klemek
2019-01-07 15:03:08 +01:00
parent afe4e79a87
commit 5016f1191c
5 changed files with 204 additions and 203 deletions
+5 -2
View File
@@ -3,8 +3,11 @@ const http = require('http').Server(app);
const io = require('socket.io')(http);
const convert = require('color-convert');
app.get('/', function (req, res) {
res.sendFile(__dirname + '/client.html');
app.get('*', function (req, res) {
if(req.originalUrl === '/')
res.sendFile(`${__dirname}/client/index.html`);
else
res.sendFile(`${__dirname}/client${req.originalUrl}`);
});
function randomColor() {