serverless / examples

Serverless Examples – A collection of boilerplates and examples of serverless architectures built with the Serverless Framework on AWS Lambda, Microsoft Azure, Google Cloud Functions, and more.
https://www.serverless.com/examples/
Other
11.45k stars 4.47k forks source link

severless not working when I added app.listen() in Express.js #621

Closed mituso89 closed 3 years ago

mituso89 commented 3 years ago

When I added any port in my express app app.listen(port, async () => { //code });

I will got error when i have more than one request to "express server"

Error: listen EADDRINUSE: address already in use :::port

if i remove that. it work well.

So i was make some test by added some log into app.listen

app.listen("4000",  () => {
  console.log(`Running at localhost:4000`);
  console.log('Initializing nodes...');
});

I see when i call any API to express for fist request i will got

Running at localhost:4000
Initializing nodes...

for second request

Error: listen EADDRINUSE: address already in use :::port

Pls give me any ideas how can resolve this problem

pgrzesik commented 3 years ago

Hello @mituso89 - it seems like a support question instead of a bug report about any of the existing examples. Please ask on forum.serverless.com or https://github.com/serverless/serverless/discussions

I'm going to close this issue