showes mime on index

This commit is contained in:
Flummi committed 2016-08-18 23:12:59 +02:00
1 parent 33b82336db
commit e179fa481d
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -267,9 +267,9 @@ http.createServer((req, res) => {
if(filePath == "./index.html") { // mainpage
var tpl = swig.compile(templates.index);
var data = { items: [] };
sql.query("select * from `f0ck`.`items` order by `id` desc", (err, rows, fields) => {
sql.query("select `id`,`mime` from `f0ck`.`items` order by `id` desc", (err, rows, fields) => {
rows.forEach((e,i,a) => {
data.items.push( e.id );
data.items.push({ "id": e.id, "mime": e.mime });
});
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(tpl(data), 'utf-8');