fixed route

This commit is contained in:
Flummi 2016-08-16 20:30:01 +02:00
parent e59651f93f
commit c5dd7b6a65

View File

@ -277,7 +277,7 @@ http.createServer((req, res) => {
else if(filePath == "./random") { else if(filePath == "./random") {
sql.query("select `id` from `f0ck`.`items` order by rand() limit 1", null, (err, rows, fields) => { sql.query("select `id` from `f0ck`.`items` order by rand() limit 1", null, (err, rows, fields) => {
res.writeHead(301, { res.writeHead(301, {
Location: req.headers.host + '/' + rows[0].id Location: '/' + rows[0].id
}); });
res.end(); res.end();
}); });