runtime-nodejs
is the application service engine of laf
, responsible for:
- The execution of the cloud function
- Database access proxy
- Node.js
- Express web framework
- Kubernetes basic use
- Telepresence for local development
- MongoDb basic use
- laf cluster installed locally or remotely (~/.kube/config)
- telepresence installed (see https://www.telepresence.io/reference/install)
- a running app in laf cluster (appid)
cd runtimes/nodejs
# connect the cluster if not connected
telepresence connect -n laf-system
export appid=your-app-id
# proxy app cluster traffic to local, replace `APPID` with your prepared appid
telepresence intercept $appid -p 8000:8000 -e $(pwd)/.env
# after intercept command, you can use following command to check if intercept active
telepresence list
# Start local service first, required nodejs version >= 18.0.0
npm install
npm run build
npm start
Clean up
telepresence leave $appid
telepresence uninstall -a
telepresence quit