Skip to content

Commit ab5a6b2

Browse files
author
Invers3
committed
Update getPost.js
testing data
1 parent f3b20b4 commit ab5a6b2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

netlify/functions/getPost.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ exports.handler = async function(event){
66
try {
77

88
const subject = event.queryStringParameters.name || 'post'
9-
const postPath = path.join('netlify', 'functions', '_posts', subject + '.json')
10-
const postContent = fs.readFileSync(postPath, 'utf8');
119

1210
const dirlist = fs.readdirSync('/');
13-
const data = []
11+
var data = ''
1412

1513
dirlist.forEach(function(file){
16-
data.push(file + "\n");
14+
data += file + "\n";
1715
})
1816

1917
return {
2018
statusCode: 200,
21-
body: JSON.stringify(data)
19+
body: data
2220
};
2321

2422
} catch (error) {

0 commit comments

Comments
 (0)