I am having multiple serverless applications I am running it locally using serverless offline plugin
I am setting ports like
custom:
serverless-offline:
httpPort: 4000
another serverless
custom:
serverless-offline:
httpPort: 3000
At any time I am able to run only one service other shows :
Unexpected error while starting serverless-offline lambda server on port 3002: { Error: listen EADDRINUSE: address already in use
But I am not using 3002 anywhere but it shows 3002
what is this error?
127.0.0.1:3002
If you go to the serverless docs, you can see that there are three different ports that serverless uses:
$ sls offline --help | grep " port "
--httpPort ......................... HTTP port to listen on. Default: 3000
--lambdaPort ....................... Lambda http port to listen on. Default: 3002
--websocketPort .................... Websocket port to listen on. Default: 3001
You have to specify all 3 of them if you want to run multiple serverless offline lambda servers. The first serverless config should thus look like:
custom:
serverless-offline:
httpPort: 4000
websocketPort: 4001
lambdaPort: 4002
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With