From 80cb3daa36cd1ba996695a10b338fe9debcc2964 Mon Sep 17 00:00:00 2001 From: Antoine-Lee Date: Sun, 4 Feb 2024 00:01:51 +0800 Subject: [PATCH] Update .gitignore and app.config.js, add environment variable in serverless.yml --- .gitignore | 2 +- frontend/app.config.js | 5 +---- serverless/serverless.yml | 11 ++++++++--- serverless/yarn.lock | 5 +++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 43d0f813..f98d2c48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules .idea .DS_Store -backend/temp +backend/temp \ No newline at end of file diff --git a/frontend/app.config.js b/frontend/app.config.js index c732fa98..7e1120a6 100644 --- a/frontend/app.config.js +++ b/frontend/app.config.js @@ -52,10 +52,7 @@ export default { favicon: './app/assets/fuxi-high-resolution-logo.png', }, extra: { - apiUrl: process.env.BACKEND_HOST || '', - serviceacc: process.env.SERVICE_ACCOUNT_EMAILJS || '', - templateid: process.env.TEMPLATE_ID_EMAILJS || '', - publicapikey: process.env.PUBLIC_API_KEY_EMAILJS || '', + apiUrl: process.env.BACKEND_HOST || 'http://0.0.0.0:3000', eas: { projectId: process.env.EAS_PROJECTID || '', }, diff --git a/serverless/serverless.yml b/serverless/serverless.yml index 95d3cbd3..31180a4d 100644 --- a/serverless/serverless.yml +++ b/serverless/serverless.yml @@ -20,11 +20,15 @@ service: fuxibackend # Check out our docs for more details frameworkVersion: "3" +useDotenv: true + provider: name: aws runtime: nodejs18.x - state: dev + # state: dev region: ap-southeast-1 + environment: + MONGO_URL: ${env:MONGO_URL} # you can overwrite defaults here # stage: dev @@ -34,6 +38,7 @@ plugins: - serverless-middleware - serverless-offline - serverless-offline-watcher + # - serverless-dotenv-plugin custom: api: @@ -70,8 +75,8 @@ custom: # - "/*" # you can define service wide environment variables here -# environment: -# variable1: value1 +# environment: +# # MONGO_URL: ${env:MONGO_URL} # you can add packaging information here package: diff --git a/serverless/yarn.lock b/serverless/yarn.lock index 548341c2..ddce2521 100644 --- a/serverless/yarn.lock +++ b/serverless/yarn.lock @@ -3456,6 +3456,11 @@ fs2@^0.3.9: memoizee "^0.4.14" type "^2.1.0" +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"