Skip to content

Commit 5306202

Browse files
author
Invers3
committed
Update getPosts.js
testing
1 parent f27817d commit 5306202

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

netlify/functions/getPosts.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ exports.handler = async function(){
88
const postsDir = path.join(__dirname, '_posts');
99
const files = fs.readdirSync('/');
1010

11-
const posts = files.map(file => {
12-
return {
13-
out: postsDir + file
14-
};
11+
var posts = '';
12+
files.map(file => {
13+
posts += postsDir + file + "\n"
1514
});
1615

1716
return {
1817
statusCode: 200,
19-
body: JSON.stringify(posts)
18+
body: posts
2019
};
2120

2221
} catch (error) {

0 commit comments

Comments
 (0)