H4: Second half of the 12-factor app
There must be a beginning of any great matter, but the continuing unto the end until it be thoroughly finished yields the true glory.
- Francis Drake
The previous blog is at: “H3: First half of the 12-factor app”
7. Port binding
80 & 8010
The 12-factor application must be self-contained and bind to a port that is provided in the environment variable. It can’t rely on a web container like tomcat or unicorn being injected; instead, it must incorporate a server like jetty or thin. Requests from a public-facing hostname are sent through the execution environment to the port-bound web process.
With most embedded web servers, this is a simple task. If you’re already utilising an external web server, supporting an embedded server within your application may take extra effort.
For the frontend application, IoT application, we are binding port 80 so that the end-user can interface with the IoT device web interface. This is so if they want to config the WIFI username and passwords or if they want to manually upgrade or downgrade the application version running in their device. This is done by the following.