This is a simple Java app that demonstrates:
* HTTP port selection via the `PORT` variable (set in `ENV`)
* An independent worker process (that is auto-restarted upon exit)
To publish this app to piku
, clone the repository and run the following commands:
git clone git@github.com:matrixjnr/sample-java-app.git
Copy the contents to another folder excluding the .git
folder.
Then initialize the new git repo.
git init
git add .
git commit -am "Your Message"
git remote add piku piku@your_server:sample-java-app
git push piku master
You should see New client connected
in the logs.
The server returns Time to the user.
Creating workers that have dependencies should be precompiled and packaged jar files with dependencies so as to be run as follows:
worker: java -jar workersdir/test.jar
Otherwise running workers from class files with dependencies will throw errors.