I have a simple groovy grails Web application that I can run on my local machine through grails-> run-app command line and access the web application (view page on gsp) on localhost using the browser. Is is possible to run/migrate the same application onto AWS Lambda, so that I can create an API gateway for this and hit the application from a browser.
I am able to use gradle build to make the .zip file. Below is the main function runs the grails application. The application has the regular grails MVC structure.
import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
}
}
What should be the handler function for AWS lambda in order to run the application serverless, if this is possible? Thanks in advance.
Is is possible to run/migrate the same application onto AWS Lambda, so that I can create an API gateway for this and hit the application from a browser.
No, but you can deploy the app to AWS so you can hit the application from a browser. One option is to use AWS Beanstalk. See https://guides.grails.org/grails-elasticbeanstalk/guide/index.html.