Preset: render-com
(switch to this preset)
Nitro supports deploying on Render with minimal configuration.
Set up application
- 创建一个新的 Web 服务 并选择包含您的代码的存储库。
- 确保选择“节点”环境。
- 根据您的包管理器,将构建命令设置为
yarn && yarn build
、npm install && npm run build
或pnpm i --shamefully-hoist && pnpm build
。
1.将启动命令更新为node .output/server/index.mjs
- 单击“高级”并添加一个环境变量,将
NITRO_PRESET
设置为render-com
。 - 单击“创建 Web 服务”。
Infrastructure as Code (IaC)
- 在存储库的根目录下创建一个名为
render.yaml
的文件,其中包含以下内容。
此文件后跟 基础架构即代码 渲染
services:
- type: web
name: <PROJECTNAME>
env: node
branch: main
startCommand: node .output/server/index.mjs
buildCommand: npm install && npm run build
envVars:
- key: NITRO_PRESET
value: render-com
- 创建一个新的蓝图实例 并选择包含您的
render.yaml
文件的存储库。
你应该可以开始了!