diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-28 18:16:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-28 18:16:03 +0100 |
commit | 42c089293fed2db9c8a09d8e55f046169b5f0844 (patch) | |
tree | 18a053fe7f1e03fc5419a8c3d2a8bc8193cb27f0 /lib/index.ts | |
parent | 7b8d75cd87e392d9ffb3defa538a041c4f7e0f0c (diff) | |
parent | acfd4d0c722ceeca6aad51be64baf117e73f286c (diff) | |
download | kronikarz-42c089293fed2db9c8a09d8e55f046169b5f0844.tar.gz kronikarz-42c089293fed2db9c8a09d8e55f046169b5f0844.zip |
Merge pull request #8 from pniedzwiedzinski/feature/generateApi v2.0
Feature/generate api
Diffstat (limited to 'lib/index.ts')
-rw-r--r-- | lib/index.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/index.ts b/lib/index.ts index ade7180..4bf4dd3 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,6 +1,7 @@ import { getPost as apiGetPost } from "./getPost"; import { getPosts as apiGetPosts } from "./getPosts"; -import { Post } from "./interfaces"; +import { generateApi as apiGenerateApi } from "./generateApi" +import Post from "./Post"; export default class Kronikarz { postPath: string; @@ -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) + } } |