-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathrender.js
74 lines (62 loc) · 1.59 KB
/
render.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import path from 'path'
import { getPaths } from '../../../../lib'
export const PROJECT_NAME = path.basename(getPaths().base)
export const RENDER_YAML = (database) => {
return `# Quick links to the docs:
# - Redwood on Render: https://render.com/docs/deploy-redwood
# - Render's Blueprint spec: https://render.com/docs/yaml-spec
services:
- name: ${PROJECT_NAME}-web
type: web
env: static
buildCommand: corepack enable && yarn install && yarn rw deploy render web
staticPublishPath: ./web/dist
envVars:
- key: SKIP_INSTALL_DEPS
value: true
routes:
- type: rewrite
source: /.redwood/functions/*
# Replace \`destination\` here after your first deploy:
#
# \`\`\`
# destination: https://my-redwood-project-api.onrender.com/*
# \`\`\`
destination: replace_with_api_url/*
- type: rewrite
source: /*
destination: /200.html
- name: ${PROJECT_NAME}-api
type: web
plan: free
env: node
region: oregon
buildCommand: corepack enable && yarn install && yarn rw build api
startCommand: yarn rw deploy render api
envVars:
${database}
`
}
export const POSTGRES_YAML = `\
- key: DATABASE_URL
fromDatabase:
name: ${PROJECT_NAME}-db
property: connectionString
databases:
- name: ${PROJECT_NAME}-db
region: oregon`
export const SQLITE_YAML = `\
- key: DATABASE_URL
value: file:./data/sqlite.db
disk:
name: sqlite-data
mountPath: /opt/render/project/src/api/db/data
sizeGB: 1`
export const RENDER_HEALTH_CHECK = `\
// render-health-check
export const handler = async () => {
return {
statusCode: 200,
}
}
`