Skip to content

Commit 980c495

Browse files
author
Invers3
committed
Update getPost.js
Testing post
1 parent 0f28d54 commit 980c495

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

netlify/functions/getPost.js

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

88
const subject = event.queryStringParameters.name || 'post'
9-
const postsDir = path.join(__dirname, '_posts', subject + '.json');
10-
const post = fs.readFileSync(postsDir);
9+
const postsDir = process.env.POSTS_DIR
10+
const postPath = path.join(postsDir, subject + '.json')
1111

1212
return {
1313
statusCode: 200,

0 commit comments

Comments
 (0)