about summary refs log tree commit diff
path: root/scripts/generateApi.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/generateApi.js')
-rwxr-xr-xscripts/generateApi.js13
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