Fix error with articles page.
This commit is contained in:
@ -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);
|
||||||
|
Reference in New Issue
Block a user