I enjoy programing with Java and discovery the different flavors of java, I mean the different frameworks, of course, nowadays the most common Java Framework is Spring, it’s often used due to it provides a lot of modules to solve almost any requirement, we can discuss more about the different modules in the future.
If you are curious and you would like to test the new technologies, then you have different options to see you application deployed in the cloud, personally I like and recommend Heroku, you can get a free account, and pair it with your Github account, define a pipeline, and create a database (with limited number of records).
Heroku uses Procfile, from heroku definition is:, A Procfile is a mechanism for declaring what commands are run by your application’s dynos on the Heroku platform.
This is an example of this:
web: java -Dserver.port=$PORT -jar -Dspring.profiles.active=heroku target/myApp-0.0.2-SNAPSHOT.jar
Once you have been deployed your application you can take a look at the logs online, from my perspective, it’s very helpfully have access to se the logs in realtime, this platform is very friendly.
As example you can create your first Spring boot Application and deploy it over Heroku, and then play with the different modules in the Cloud.
If you aren’r familiar with Java and its frameworks, then a good start with spring boot is the following link:http://start.spring.io/
This will create for you the structure and basis to run a “Hello World” app, so please don’t doubt about create your application from scratch, read more about spring and create your own POC, because in a short time can convey as one of the best ideas or platforms.
Heroku is not only to Java it also support different kinds of languages, the most commons are JS, Python and Ruby, hence if you aren’t Java lover you can try Heroku also with your favorite language.
In the other hand if would you like setting up the whole environment locally, then you can use a Raspberry Pi, in my experience I often use nginx as proxy server, of course, if you choose this option need perform more configurations, I mean you need a little bit more skills besides programming.
Usually needs forward the port 80 of your modem to your Raspberry.
Configure nginx to listen the port 80
Configure nginx to forward locally depending of the context requested.
Create a service script to start|stop|restart|status our application.
Add our service script at the start up.
At this point we can access our app using our public IP, but if we would like to use a custom domain, then we need buy the domain and a DNS service, usually the cost of the domains is lower than DNS service.
As conclusion, I can suggest you Heroku as first point to see your app deployed on Internet, but if you have an special love to create your own infrastructure, then don’t hesitate and try a Raspberry Pi with a lower cost.
I have been writing a brief introduction of how can you see your java application over Heroku, and also provide you the first link to create your “hello world” using Spring boot, hence the next discussion will be about the Dependency Injection and the Inverse of Controls (IoC).