Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async route timeout #20

Open
msniezynski opened this issue Mar 23, 2020 · 2 comments
Open

Async route timeout #20

msniezynski opened this issue Mar 23, 2020 · 2 comments

Comments

@msniezynski
Copy link

msniezynski commented Mar 23, 2020

I run that with serverless-offline plugin, and I have an issue with an async route (after 30 seconds):

Replying timeout after 30000ms

Example:

const express = require("serverless-express/express");
const handler = require("serverless-express/handler");
const app = express();

app.get("/test", async (req, res) =>
    res.json({
        status: "SUCCESS"
    })
);

exports.handler = handler(app);

Of course, my function will have some async stuff.

How to fix that?

@mikestaub
Copy link
Owner

This might be an issue with API Gateway which has a max request timeout of 30 seconds.

https://stackoverflow.com/questions/54299958/how-can-i-set-the-aws-api-gateway-timeout-higher-than-30-seconds

@msniezynski
Copy link
Author

msniezynski commented Mar 23, 2020

The problem is the request returns a response (JSON) before that alert. Then it appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants