Skip to content

Commit

Permalink
Merge branch 'testing' of https://github.com/Codernauts/Hermes into t…
Browse files Browse the repository at this point in the history
…esting
  • Loading branch information
ThePerkinrex committed Nov 13, 2018
2 parents b9c5322 + 8a8054a commit 692c5d0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"cookie-parser": "^1.4.3",
"express": "^4.16.4",
"express-favicon": "^2.0.1",
"file-exists": "^5.0.1",
"redis": "^2.8.0",
"uuid": "^3.3.2"
},
Expand Down
17 changes: 15 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const utils = require('./server/utils');
const bodyParser = require('body-parser'); // Peticiones POST
const cookieParser = require('cookie-parser'); // Cookies
const favicon = require('express-favicon'); // Favicon
const fileExists = require('file-exists');
const path = require('path');

const web_client_path = __dirname + '/web_client/';
Expand Down Expand Up @@ -47,11 +48,23 @@ app.get('/chat', function(req, res){
});

app.get('/js/:file', function(req, res){
res.sendFile(js_path + req.params.file);
fileExists(js_path + req.params.file, function (err, exists) {
if (exists) {
res.sendFile(js_path + req.params.file);
} else {
res.sendStatus(404)
}
});
});

app.get('/css/:file', function(req, res){
res.sendFile(css_path + req.params.file);
fileExists(css_path + req.params.file, function (err, exists) {
if (exists) {
res.sendFile(css_path + req.params.file);
} else {
res.sendStatus(404)
}
});
});

app.get('/clearMessages', function(req, res){
Expand Down

0 comments on commit 692c5d0

Please sign in to comment.