是否可以使用 aws amplify 构建和部署 cube.js。如果是,它的构建设置是什么?
Is it possible to build and deploy cube.js using aws amplify. If yes, what would be build settings for it?
我的项目包括 cube.js 后端和 React 前端。我能够使用 aws amplify 为前端设置 CICD,但我不确定我是否可以在 aws amplify 上部署 cube.js。
在本地环境中,我首先 运行 'npm run dev' 到 运行 在 localhost:4000 上启动服务的后端,然后我用 [=24= 启动反应项目] 并在 localhost:3000 上 运行s。我想使用 aws amplify
构建和部署后端和前端
我的项目设置与此示例类似
https://github.com/cube-js/cube.js/tree/master/examples/react-dashboard
在 aws amplify 中,我的前端构建设置如下
version: 0.1
frontend:
phases:
preBuild:
commands:
- cd dashboard
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: dashboard/build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
如何在其中包含我的后端 cube.js 项目?
您可以使用 Cube.js 无服务器模板将后端部署为一组 lambda:https://cube.dev/docs/deployment#serverless。通过这种方式,您可以将 serverless deploy -v
命令作为 Amplify 构建周期的一部分,例如:
backend:
phases:
preBuild:
commands:
- serverless deploy -v
我的项目包括 cube.js 后端和 React 前端。我能够使用 aws amplify 为前端设置 CICD,但我不确定我是否可以在 aws amplify 上部署 cube.js。
在本地环境中,我首先 运行 'npm run dev' 到 运行 在 localhost:4000 上启动服务的后端,然后我用 [=24= 启动反应项目] 并在 localhost:3000 上 运行s。我想使用 aws amplify
构建和部署后端和前端我的项目设置与此示例类似 https://github.com/cube-js/cube.js/tree/master/examples/react-dashboard
在 aws amplify 中,我的前端构建设置如下
version: 0.1
frontend:
phases:
preBuild:
commands:
- cd dashboard
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: dashboard/build
files:
- '**/*'
cache:
paths:
- node_modules/**/*
如何在其中包含我的后端 cube.js 项目?
您可以使用 Cube.js 无服务器模板将后端部署为一组 lambda:https://cube.dev/docs/deployment#serverless。通过这种方式,您可以将 serverless deploy -v
命令作为 Amplify 构建周期的一部分,例如:
backend:
phases:
preBuild:
commands:
- serverless deploy -v