Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtime-nodejs): fix custom env unable to read #728

Merged
merged 1 commit into from
Feb 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions runtimes/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,30 @@ cd runtimes/nodejs

# proxy app cluster traffic to local, replace `APPID` with your prepared appid
telepresence connect
telepresence intercept APPID -n APPID -p 8000:8000 -e $(pwd)/.env

# required nodejs version >= 18.0.0
# Start local service first, required nodejs version >= 18.0.0
npm install

npm run build

npm start
# intercept
telepresence intercept APPID -n APPID -p 8000:8000 -e $(pwd)/.env

# after intercept command, you can use following command to check if intercept active
telepresence list -n APPID
# if success, you would see like below
Your-APPID: intercepted
Intercept name : APPID-APPID
State : ACTIVE
Workload kind : Deployment
Destination : 127.0.0.1:8000
Service Port Identifier: 8000
Intercepting : all TCP requests
```

> Clean up

```bash
telepresence leave APPID-APPID
```
8 changes: 1 addition & 7 deletions runtimes/nodejs/src/support/cloud-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,8 @@ function createCloudSdk() {
env: {
DB_URI: Config.DB_URI,
SERVER_SECRET: Config.SERVER_SECRET,
APP_ID: process.env.APP_ID,
OSS_ACCESS_KEY: process.env.APP_ID,
OSS_ACCESS_SECRET: process.env.OSS_ACCESS_SECRET,
OSS_REGION: process.env.OSS_REGION,
OSS_INTERNAL_ENDPOINT: process.env.OSS_INTERNAL_ENDPOINT,
OSS_EXTERNAL_ENDPOINT: process.env.OSS_EXTERNAL_ENDPOINT,
NPM_INSTALL_FLAGS: process.env.NPM_INSTALL_FLAGS || '',
RUNTIME_IMAGE: Config.RUNTIME_IMAGE,
...process.env,
},
}

Expand Down