We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b77981d commit 50280abCopy full SHA for 50280ab
netlify/functions/getPost.js
@@ -8,12 +8,11 @@ exports.handler = async function(event){
8
const subject = event.queryStringParameters.name || 'post'
9
const postsDir = process.env.POSTS_DIR
10
const postPath = path.join(postsDir, subject + '.json')
11
+ const postContent = fs.readFileSync(postPath, 'utf8');
12
13
return {
14
statusCode: 200,
- body: {
15
- out: postsDir
16
- }
+ body: JSON.stringify(JSON.parse(postContent))
17
};
18
19
} catch (error) {
0 commit comments