diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-11 19:33:24 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-11 19:33:24 +0200 |
commit | 5855198867cc0586b71b6d64f4581dffc7fe6cbb (patch) | |
tree | 663823d5af3711eb2777cef5a6e34484c901f9d9 /scripts/generateApi.js | |
parent | 1e248151d5bd60e8c94ab26f272e5e9cf900ca7a (diff) | |
download | puszcza-5855198867cc0586b71b6d64f4581dffc7fe6cbb.tar.gz puszcza-5855198867cc0586b71b6d64f4581dffc7fe6cbb.zip |
Add api endpoint
Diffstat (limited to 'scripts/generateApi.js')
-rwxr-xr-x | scripts/generateApi.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/generateApi.js b/scripts/generateApi.js new file mode 100755 index 0000000..f439252 --- /dev/null +++ b/scripts/generateApi.js @@ -0,0 +1,13 @@ +let { getPosts } = require('../api/api') + +let posts = getPosts() + +posts = posts.map(({ year, month, day, title, route }) => { + return { + date: `${year}-${month}-${day}`, + title, + route + } +}) + +console.log(posts) \ No newline at end of file |