diff --git a/src/app/article/[...slug]/page.tsx b/src/app/article/[...slug]/page.tsx index 00c9113..41512ab 100644 --- a/src/app/article/[...slug]/page.tsx +++ b/src/app/article/[...slug]/page.tsx @@ -13,11 +13,12 @@ import "@/app/index.css" import { Post } from "@/models"; import { Attributes } from "@sequelize/core"; import { DeepPartial } from "@/util/deeppartial"; +import { constructAPIUrl } from "@/util/url/urlConstructor"; async function getData(slug:string):Promise> { // Get all posts from the API - const res = await fetch(`http://localhost:3000/api/post/${slug}`); + const res = await fetch(await constructAPIUrl(`post/${slug}`)); // The return value is *not* serialized // You can return Date, Map, Set, etc. // Recommendation: handle errors