mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added motd support, and minor logging improvements
This commit is contained in:
parent
02c513c090
commit
7284358121
3 changed files with 13 additions and 7 deletions
|
@ -32,6 +32,7 @@ var stat = require('./stat.js');
|
|||
var bodyParser = require('body-parser');
|
||||
|
||||
const recivedFiles = "public/recivedfiles";
|
||||
const motdFile = "public/motd";
|
||||
const publicFile = "public/data/public";
|
||||
const staticFile = "public/data/static";
|
||||
const countFile = "public/data/count";
|
||||
|
@ -101,12 +102,16 @@ app.get('/manual', function(req, res) {
|
|||
});
|
||||
|
||||
app.get('/public', function(req, res) {
|
||||
res.write(utils.ReadFile(publicFile));
|
||||
var response = '@' + utils.ReadFile(motdFile);
|
||||
response += utils.ReadFile(publicFile);
|
||||
res.write(response);
|
||||
res.end();
|
||||
});
|
||||
|
||||
app.get('/static', function(req, res) {
|
||||
res.write(utils.ReadFile(staticFile));
|
||||
var response = '@' + utils.ReadFile(motdFile);
|
||||
response += utils.ReadFile(staticFile);
|
||||
res.write(response);
|
||||
res.end();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue