Hosting a Ninja application is pretty straight forward. At a very basic level you only need a Java runtime environment - then you can use Ninja’s standalone mode and you are done.
But sometimes you don’t want to host the application yourself and therefore we have compiled a list of cloud hosting providers that support Ninja.
Google’s App Engine is a great hosting service provided by Google. The really cool feature is that it scales automatically. Deploy and never worry about any scaling issues - that’s the basic promise of the App Engine.
Ninja is fully compatible to the App Engine via the ninja-appengine module.
Please follow the guide at: https://github.com/ninjaframework/ninja-appengine/
Ninja is fully supported by Heroku. Check out the blog post at: http://ars-codia.raphaelbauer.com/2013/07/running-ninja-web-framework-apps-on.html
One other cloud option is Clever Cloud, a Europe-based PaaS company. It supports different Java runtimes, with automatic scaling and cloud-friendly features. You can for example deploy your Ninja application directly from a GitHub public or private repository, by following these simple steps : * First, create the file clevercloud/jar.json at the root of your project
{ “build”: { “type”: “maven”, “goal”:“package -DskipTests” }, “deploy”: { “type”: “jar”, “jarName”: “target/yourApplicationArtifactId-1.0-SNAPSHOT.jar” } }
That’s enough to deploy a first instance of your application. And each time you will publish modifications on the repository, it will run the maven package command and use the generated fat Jar as an executable.
You can also add a database (PostgreSQL, MySQL…) to your application, by “Add an add-on” feature. Link it to your application and then use the add-on environment variables in your conf/application.conf file(using ${env:XXX} format). Some other add-ons are availalble, like an S3 file storage.