diff --git a/lib/posts.ts b/lib/posts.ts index cbb60fb..03f261a 100644 --- a/lib/posts.ts +++ b/lib/posts.ts @@ -83,4 +83,4 @@ export const allPostsPath = async () => { export const readSinglePost = async (slug: string) => { const filename = path.join(`${dataPath}/${slug}.mdx`); return await fs.readFile(filename, { encoding: 'utf-8' }); -}; +}; \ No newline at end of file diff --git a/lib/postsFetcher.ts b/lib/postsFetcher.ts new file mode 100644 index 0000000..2cab125 --- /dev/null +++ b/lib/postsFetcher.ts @@ -0,0 +1,9 @@ +const baseUrl = 'https://blog-backend-beige-pi.vercel.app/'; + +/** + * Read post meta info from backend + */ +const readFileMate = async (filename: string) => { + const target = `${baseUrl}/${filename}.mdx`; + const result = await (await fetch(target)).text(); +}; \ No newline at end of file