diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-03 00:24:34 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-03 00:24:34 +0100 |
commit | c11d7a84aa59e9b1179a9834129b2d776bab8bca (patch) | |
tree | c5c053ace0b8fca3c74fee360036bf1e2efd1c2c /lib/index.ts | |
parent | 7b8d75cd87e392d9ffb3defa538a041c4f7e0f0c (diff) | |
download | kronikarz-c11d7a84aa59e9b1179a9834129b2d776bab8bca.tar.gz kronikarz-c11d7a84aa59e9b1179a9834129b2d776bab8bca.zip |
Add post endpoints
Diffstat (limited to 'lib/index.ts')
-rw-r--r-- | lib/index.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/index.ts b/lib/index.ts index ade7180..f9647bc 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,5 +1,6 @@ import { getPost as apiGetPost } from "./getPost"; import { getPosts as apiGetPosts } from "./getPosts"; +import { generateApi as apiGenerateApi } from "./generateApi" import { Post } from "./interfaces"; export default class Kronikarz { @@ -15,4 +16,8 @@ export default class Kronikarz { getPost(year: string, month: string, day: string, title: string): Post { return apiGetPost({ year, month, day, title }, this.postPath); } + generateApi(path: string) { + const posts = this.getPosts(); + apiGenerateApi(posts, path) + } } |