You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serverless plugin that creates ngrok public tunnel on localhost.
Optionally, writes tunnels url to .env file and deletes them after session is over. Useful for when you want to expose url for other applications to use (for example mobile application).
Installation
Add serverless-ngrok-tunnel to your project:
npm install --save-dev serverless-ngrok-tunnel
Then inside your serverless.yml file add following entry to the plugins section:
plugins:
- serverless-ngrok-tunnel
Usage
First you will need to configure tunnels. In your serverless.yml file add:
custom:
ngrokTunnel:
envPath: '../.env'# optional. Path to your .env file, relative to serverless.yml filetunnels: # required# if you are using `serverless-offline` plugin, expose api gateway
- port: 8000# requiredenvProp: 'API_GATEWAY'# optional. property in .env file to assign url value to# or if you are using `serverless-iot-offline` plugin, expose IoT endpoint
- port: 1884envProp: 'IOT_ENDPOINT'ws: true # expose web-socket urlpath: '/mqqt'# additional path to url
- port: 9000ngrokOptions: # optional. custom ngrok optionsauthtoken: '12345'region: 'us'subdomain: 'my-subdomain'
For a list of available ngrok options checkout ngrok documentation.
To start tunnel/s run sls tunnel.
If you are using serverless-offline plugin
v2: start offline with option flag: sls offline start --tunnel=true.
v3: start offline with option flag: sls offline start --param="tunnel=true".