Open alex88 opened 5 years ago
I'm trying to use this plugin, I've added it to my config:
custom: stage: "${opt:stage, self:provider.stage, 'dev'}" production: GW_URL: { "Fn::Join" : ["", [ "https://", { "Ref" : "ApiGatewayRestApi" }, ".execute-api.${self:custom.region, ''}.amazonaws.com/${self:custom.stage}" ] ] } dev: GW_URL: "http://localhost:3000" ngrokTunnel: envPath: .env tunnels: - port: 3000 envProp: 'API_GATEWAY' plugins: - serverless-ngrok-tunnel - serverless-offline
however when I do sls tunnel it just shows Serverless: Starting tunnels... and then it quits.
sls tunnel
Serverless: Starting tunnels...
I've tried to log some values around here:
runTunnel ({port, envProp, ws, path, ngrokOptions}) { try { ngrok.connect({ addr: port, proto: 'http', region: 'eu', ...(ngrokOptions || {}) }, (err, url) => { console.log('callback'); if (err) { this.log(`Unable to create tunnel: ${err.message}`) } else { this.onConnect(url, envProp, ws, path) } }) ngrok.on('disconnect', () => this.onTunnelClose()) ngrok.on('error', (e) => this.errorHandler(e)) } catch (e) { this.errorHandler(e) } }
and it calls ngrock.connect but nothing else, the callback nor the catch or the disconnect/error event handlers are called
ngrock.connect
Node 12.4.0 on OSX 10.14.5
Put serverless-ngrok-tunnel after serverless-offline in serverless.yml, it should work.
serverless-ngrok-tunnel
serverless-offline
serverless.yml
I'm trying to use this plugin, I've added it to my config:
however when I do
sls tunnel
it just showsServerless: Starting tunnels...
and then it quits.I've tried to log some values around here:
and it calls
ngrock.connect
but nothing else, the callback nor the catch or the disconnect/error event handlers are calledNode 12.4.0 on OSX 10.14.5