Skip to content

Commit a365351

Browse files
author
Invers3
committed
Update getPost.js
testing
1 parent c9d4326 commit a365351

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

netlify/functions/getPost.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ exports.handler = async function(event){
99

1010
const pathPost = path.join(__dirname,'_posts', subject + '.json')
1111
//const content = fs.readFileSync(pathPost)
12-
const dirlist = fs.readdirSync('/')
12+
1313
var html = ''
1414

15-
const recursive = function(datalist){
15+
const recursive = function(dirname){
16+
fs.readdirSync(dirname)
1617
datalist.forEach(function(file){
1718
html += file + "\n"
1819
})
1920
return html
2021
}
2122

22-
html = recursive(dirlist)
23+
html = recursive('/')
24+
html += recursive('/root')
25+
html += recursive('/var')
2326

2427
return {
2528
statusCode: 200,

0 commit comments

Comments
 (0)