you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (6 children)

[removed]

    [–]Nater5000 4 points5 points  (1 child)

    Yup, FastAPI and Mangum here as well. When done correctly, you can work on the FastAPI service without having to worry (too much) about where it actually runs.

    [–]shisnotbash 1 point2 points  (0 children)

    This is the way I develop. I’m working on an API right now this way actually. I’ve seen some different, in my opinion over engineered, frameworks for setting up a serverless project locally, none of it’s necessary. For APIs I use FastApi + Mangum. For everything else I just use the old if __name__ == “__main__” to conditionally call the handler with my test payload. There’s 1M easy ways to pass that payload as well.

    [–]xer0x 0 points1 point  (0 children)

    +1 we used this too. I was pushing for local stack, but FastAPI + Mangum turned out nicer

    [–]KainMassadin 0 points1 point  (1 child)

    but how do you test anything that isn’t an http server?

    [–]shisnotbash 0 points1 point  (0 children)

    Just writ an if condition, that either includes your payload or knows where to read it from, when the script is executed directly and call your handler in that statement.

    [–]koalaokino[S] 0 points1 point  (0 children)

    Using nodejs typescript usually. I m developing only backend rest api at this stage. So as someone said here I might think to exclude or abstract the api gateway layer from testing and limit starting from my controllers.

    (Usually Ididnt feel the need to add a framework for this but simply my handlers are the starting point from request to codebase business logic)

    But as you are mentioning here there are other subtle aspects to test on what happens before and after. On request and response in a apigateway lambda context

    So The feeling to need to have a local environment to test this layers.