Skip to content

Instantly share code, notes, and snippets.

@bytekast
Last active March 25, 2017 20:57
Show Gist options
  • Save bytekast/c1ac17213dc6da0cffe83ff69e786fd8 to your computer and use it in GitHub Desktop.
Save bytekast/c1ac17213dc6da0cffe83ff69e786fd8 to your computer and use it in GitHub Desktop.
@SpringBootApplication
@Log4j
class LambdaHandler implements RequestHandler<Map, Response> {
@Memoized
ApplicationContext getApplicationContext(String[] args = []) {
return SpringApplication.run(LambdaHandler.class, args)
}
@Override
Response handleRequest(Map input, Context context) {
final Request request = new Request(input, context)
DispatcherService dispatcher = getApplicationContext().getBean(DispatcherService.class)
return dispatcher.dispatch(request)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment