[英]Is it possible to build and deploy cube.js using aws amplify. If yes, what would be build settings for it?
My project includes cube.js backend and react frontend.我的项目包括 cube.js 后端和 react 前端。 I was able to set up CICD using aws amplify for the front end but I am unsure if I can deploy cube.js on aws amplify.
我能够为前端使用 aws amplify 设置 CICD,但我不确定是否可以在 aws amplify 上部署 cube.js。
In the local environment I first run 'npm run dev' to run the backend which starts the service on localhost:4000 and I start the react project with 'npm start' and it runs on localhost:3000.在本地环境中,我首先运行“npm run dev”来运行在 localhost:4000 上启动服务的后端,然后使用“npm start”启动反应项目,它在 localhost:3000 上运行。 I would like to build and deploy both backend and frontend using aws amplify
我想使用 aws amplify 构建和部署后端和前端
My project is set up similar to this example https://github.com/cube-js/cube.js/tree/master/examples/react-dashboard我的项目设置类似于此示例https://github.com/cube-js/cube.js/tree/master/examples/react-dashboard
In aws amplify, I have the build settings for my frontend as below在 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/**/*
How do I include my backend cube.js project in this?如何在其中包含我的后端 cube.js 项目?
You can use Cube.js Serverless template to deploy backend as a set of lambdas: https://cube.dev/docs/deployment#serverless .您可以使用 Cube.js 无服务器模板将后端部署为一组 lambda: https://cube.dev/docs/deployment#serverless 。 This way you can include
serverless deploy -v
command as part of your Amplify build cycle like:这样,您可以将
serverless deploy -v
命令作为 Amplify 构建周期的一部分,例如:
backend:
phases:
preBuild:
commands:
- serverless deploy -v
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.