Skip to content

Commit 70a81bc

Browse files
author
Invers3
committed
update app
testing post
1 parent 90a53a9 commit 70a81bc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
const fs = require('fs');
22
const path = require('path');
33

4-
exports.handler = async function(){
4+
exports.handler = async function(event){
55

66
try {
77

8-
const postsDir = path.join(__dirname, '_posts', 'post.json');
8+
const subject = event.queryStringParameters.name || 'post'
9+
const postsDir = path.join(__dirname, '_posts', subject + '.json');
910
const post = fs.readFileSync(postsDir);
10-
11-
console.log(post)
1211

1312
return {
1413
statusCode: 200,

0 commit comments

Comments
 (0)