Skip to content

Commit c689e59

Browse files
committed
Adding a Netlify build script
1 parent 9610325 commit c689e59

File tree

2 files changed

+66
-7
lines changed

2 files changed

+66
-7
lines changed

netlify.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Global settings applied to the whole site.
2+
# “base” is directory to change to before starting build, and
3+
# “publish” is the directory to publish (relative to root of your repo).
4+
# “command” is your build command.
5+
6+
[build]
7+
base = ""
8+
publish = "build"
9+
command = "REACT_APP_STAGE=dev npm run build"
10+
11+
# Production context: All deploys to the main
12+
# repository branch will inherit these settings.
13+
[context.production]
14+
command = "REACT_APP_STAGE=prod npm run build"
15+
16+
# Deploy Preview context: All Deploy Previews
17+
# will inherit these settings.
18+
[context.deploy-preview]
19+
command = "REACT_APP_STAGE=dev npm run build"
20+
21+
# Branch Deploy context: All deploys that are not in
22+
# an active Deploy Preview will inherit these settings.
23+
[context.branch-deploy]
24+
command = "REACT_APP_STAGE=dev npm run build"
25+
26+
# Always redirect any request to our index.html
27+
# and return the status code 200.
28+
[[redirects]]
29+
from = "/*"
30+
to = "/index.html"
31+
status = 200

src/config.js

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
1-
export default {
2-
MAX_ATTACHMENT_SIZE: 5000000,
1+
const dev = {
2+
STRIPE_KEY: "pk_test_v1amvR35uoCNduJfkqGB8RLD",
3+
s3: {
4+
REGION: "us-east-1",
5+
BUCKET: "notes-app-2-api-dev-attachmentsbucket-6wbhcogxihbo"
6+
},
7+
apiGateway: {
8+
REGION: "us-east-1",
9+
URL: "https://api.serverless-stack.seed-demo.club/dev"
10+
},
11+
cognito: {
12+
REGION: "us-east-1",
13+
USER_POOL_ID: "us-east-1_yKOQs2dWK",
14+
APP_CLIENT_ID: "1h0r8s763vnqj4id6dvguanp8f",
15+
IDENTITY_POOL_ID: "us-east-1:dedfd34a-9d7e-4bf2-a1dd-ef603bac2ecb"
16+
}
17+
};
18+
19+
const prod = {
320
STRIPE_KEY: "pk_test_v1amvR35uoCNduJfkqGB8RLD",
421
s3: {
522
REGION: "us-east-1",
6-
BUCKET: "notes-app-uploads"
23+
BUCKET: "notes-app-2-api-prod-attachmentsbucket-1h5n5ttet1hy0"
724
},
825
apiGateway: {
926
REGION: "us-east-1",
10-
URL: "https://5by75p4gn3.execute-api.us-east-1.amazonaws.com/prod"
27+
URL: "https://api.serverless-stack.seed-demo.club/prod"
1128
},
1229
cognito: {
1330
REGION: "us-east-1",
14-
USER_POOL_ID: "us-east-1_udmFFSb92",
15-
APP_CLIENT_ID: "4hmari2sqvskrup67crkqa4rmo",
16-
IDENTITY_POOL_ID: "us-east-1:ceef8ccc-0a19-4616-9067-854dc69c2d82"
31+
USER_POOL_ID: "us-east-1_TwYpMXIJH",
32+
APP_CLIENT_ID: "6kfg0o7qo2i3ndk2ur906sc5fd",
33+
IDENTITY_POOL_ID: "us-east-1:f4c754b4-24f0-4754-8596-30afedece1fc"
1734
}
1835
};
36+
37+
// Default to dev if not set
38+
const config = process.env.REACT_APP_STAGE === 'prod'
39+
? prod
40+
: dev;
41+
42+
export default {
43+
// Add common config values here
44+
MAX_ATTACHMENT_SIZE: 5000000,
45+
...config
46+
};

0 commit comments

Comments
 (0)