riyawilliams

Is there a place for a REST controller in serverless?

Discussion created by riyawilliams on Sep 18, 2018
Latest reply on Sep 19, 2018 by joakim.johansson

Hai All,

Is it redundant to have a REST controller in a servlerss application that has http events?

e.g. Imagine a serverless application like this:

functions:   hello:     handler: com.sandbox.serverless.Handler::handleRequest     events:        - http:            path: message/hello            method: get

Would it be redundant to have the handler method proxy a REST controller? If I had a REST controller, it would do this work:

  • Respond to HTTP event
  • Validate input
  • Invoke business layer function
  • Return response to caller

Should I just do this work in the handler function?

Regards,

Riya.

Aws developer

Outcomes