API localhost 和部署问题 Next JS in VERCEL

问题描述

我无法将我的应用部署到 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 端点。有什么想法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)