Fix error with articles page.

This commit is contained in:
Matjaz
2022-01-08 22:09:20 +01:00
parent a7ad340283
commit 8a3d07b228

View File

@ -8,8 +8,6 @@ function toTitleCase(str) {
/* GET home page. */ /* GET home page. */
function articles(request, response) { function articles(request, response) {
var articlesPage = `20 text/gemini\r\n\r\n# Articles by Uplink:SI\r\nList of Articles:\r\n${contents}\r\n`;
try { try {
var articleList = fs.readdirSync('./articles'); var articleList = fs.readdirSync('./articles');
articleList.reverse(); articleList.reverse();
@ -19,6 +17,7 @@ function articles(request, response) {
title = toTitleCase(title); title = toTitleCase(title);
contents += `=> /articles/${item} ${title}\r\n`; contents += `=> /articles/${item} ${title}\r\n`;
}); });
var articlesPage = `20 text/gemini\r\n\r\n# Articles by Uplink:SI\r\nList of Articles:\r\n${contents}\r\n`;
response.send(articlesPage); response.send(articlesPage);
} catch (error) { } catch (error) {
response.error(51); response.error(51);