我用Gatsby和Strapi (开源cms)做了一个小项目。当我在本地运行项目时,我完美地从Strapi获得了所有的内容类型。但是,当我想要将项目部署到netlify时,部署失败,并且在控制台中收到404错误。
info Starting to fetch data from Strapi - https://agitated-euclid-2d5577.netlify.com/blogposts
error "gatsby-source-strapi" threw an error while running the sourceNodes lifecycle:
Request failed with status code 404在我的gatsby-config.js中,我使用gatsby-source-strapi。
{
resolve: `gatsby-source-strapi`,
options: {
apiURL: process.env.DEPLOY_URL
? "https://agitated-euclid-2d5577.netlify.com"
: "http://localhost:1337",
contentTypes: [`blogposts`],
queryLimit: 1000,
},
},在我的Strapi仪表板中,我已经将blogpost权限设置为find。我不认为这是因为权限,错误出现了。
发布于 2019-11-19 17:36:33
您的部署URL不正确。它应该是您生产中的Strapi应用程序的URL。
在这里您可以设置生产环境中的前端应用程序的URL。
如果您遵循tuto,我们将设置应用程序的HEROKU URL。这是Strapi应用程序的生产URL。而不是您的前端应用程序的URL。
https://stackoverflow.com/questions/58864313
复制相似问题