diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-29 12:22:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 12:22:09 +0100 |
commit | 3e5f329cd8c9692e24f5fd56a5e4189bf2202e0d (patch) | |
tree | 8f9140f2326df571a6990df6e9cbd1525f19e374 /api/index.js | |
parent | 3c2ac6715dfffc2eda38e014ed0b4986ccc7f75a (diff) | |
parent | 0a8355312990db95de3aa4e946b907ed0abf5a12 (diff) | |
download | puszcza-3e5f329cd8c9692e24f5fd56a5e4189bf2202e0d.tar.gz puszcza-3e5f329cd8c9692e24f5fd56a5e4189bf2202e0d.zip |
Merge pull request #26 from 19pdh/feature/json-api
Feature/json api
Diffstat (limited to 'api/index.js')
-rw-r--r-- | api/index.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/api/index.js b/api/index.js index 5658365..7843302 100644 --- a/api/index.js +++ b/api/index.js @@ -1,7 +1,10 @@ -import Kronikarz from 'kronikarz' +export const apiUrl = 'https://puszcza.netlify.com/api' -const POSTS_PATH = './content/wpisy' - -const k = new Kronikarz(POSTS_PATH) - -export default k +export const parsePosts = (posts) => + posts.map((post) => ({ + title: post.title, + image: post.image, + description: post.description, + route: post.path, + meta: post.meta, + })) |