API localhost 和部署问题 Next JS in VERCEL

时间:2021-05-13 18:56:48

标签: deployment localhost next.js

我无法将我的应用部署到 Vercel。

export async function getStaticProps() {
    const res = await fetch(`https://localhost:3000/api/dbtest`)
    const posts = await res.json()

    return {
        props: {
            posts,
        },
        // Next.js will attempt to re-generate the page:
        // - When a request comes in
        // - At most once every second
        revalidate: 1, // In seconds
    }
}

在我的索引站点上。如果我将其替换为 https://friendly-friend.de/api/dbtest,则无法部署它,因为没有 json 端点。有什么想法吗?

0 个答案:

没有答案