在哪里部署 Strapi 后端并将其与 Nuxt 前端一起使用?

Where to deploy Strapi backend and use it with Nuxt frontend?

我有一个部署到 Google App Engine 的 Nuxt 前端。 我可以将 Strapi 部署到 Netlify 吗?或者有没有可以免费部署 Strapi 的平台? 在部署之后,Nuxt 中需要更改的确切设置是什么?

我对 apollo 的设置。

apollo: {
  clientConfigs: {
    default: {
      httpEndpoint: 'http://localhost:1337/graphql',
    },
  },
},

@nuxtjs/strapi设置在Documentation.

modules: ['@nuxtjs/strapi'],
strapi: {
  entities: ['restaurants', 'categories'],
  url: 'http://localhost:1337'
},

如果我使用目前未使用的@nuxtjs/strapi,我想我必须将 Heroku URL 替换为 localhost:1337? 如果我想使用 apollo 怎么办?我应该把 Heroku URL 放在哪里,因为它有 graphql URL 的 httpEndpoint 字段?

Strapi 需要一个 Node.js 服务器,所以 Heroku 是个好主意。他们确实有一个免费的 dyno 层,需要一些时间才能启动,但没有问题,因为您将把它用作无头 CMS。

部署后,您需要在 nuxt.config.js 中更新 Strapi 的 URL。我想这差不多就是全部了。

您将在他们的官方文档中获得所有信息:https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.html