Serverless Local Java is a cli tool for running serverless java application using docker.
- Lambda execution
- Fully containerized
- Java 8
- Docker
- Maven
Tool uses a number of open source projects to work properly:
- [Spark Java] - Spark Core
- [Apache Commons] - Commandline arguments parsing
Install the dependencies and devDependencies and start the server.
$ mvn clean install
$ echo "alias jsls='java -jar $(pwd)/target/serverless-local-java.jar'" >> ~/.bashrc
Lets try with the examples/
folder where you can test it locally.
cd examples/simple-api
mvn clean install
./run.sh
You should have a server running in 4567
port . Now lets send a simple curl request.
curl -d '{"name":"Tom"}' http://localhost:4567/api/simple-api
It should print like this:
{"message":"Hello Tom"}
If you are using any IDE like Netbeans, IntelliJ which auto generates the classes for you and this tool will automatically pickup the new classes and no need to re-run. You can use your own lambda layers with custom docker image to run your lambda.
Want to contribute? Great!