More docs for monolithic case needed #1007

Closed
markstos opened this Issue Apr 14, 2016 · 2 comments

Projects

None yet

5 participants

@markstos

In particular, I couldn't find docs about mapping multiple endpoints to a single handler.

What communicates to the handler which endpoint has been called?

The doc section on "Monolithic" links to the a GraphQL project which has only one endpoint, making it a poor example of a typical monolithic app.

For developers coming from Express, it's a natural to think about how an Express app might be designed with a single 'server' with several URLs that are handled by it.

@flomotlik flomotlik added area/docs and removed docs labels May 12, 2016
@flomotlik flomotlik added this to the 1.0 milestone May 12, 2016
@dperjar
dperjar commented Aug 2, 2016 edited

Does anyone have something like this running, and can you describe what your s-function.json and the handler function(s) look like until the docs are improved?

EDIT: The description of the 'Microservices' architecture in the docs has a suggestion for accomplishing this sort of pattern:

For example, a REST API could have a users resource containing one 'all' function that handles all actions for users. Assign endpoints for create, read, update, delete to the all function. API Gateway can pass the METHOD and PATH into your function via the event object, so you can determine inside your function how to handle/route incoming request.

I was struggling with understanding how to do the routing, not realizing API Gateway should be set up to pass METHOD and PATH which are then routed by your handler to the appropriate function in your one Lambda. The s-function.json is also pretty simple at that point, you just add endpoints to the array already there.

@flomotlik
Contributor

We're going to do more example on this in the future. Closing here for now as we have concrete plans for this already in place

@flomotlik flomotlik closed this Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment