showes mime on index
This commit is contained in:
@ -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');
|
||||
|
Reference in New Issue
Block a user