One of the most famous examples in programming is the iconic "Hello world". To follow this tradition, we use this very example to show all the steps needed for turning existing or new code into a working application powered by the new cloud application platform called Zerops.
First things first: What is Zerops?
Zerops is a recently introduced PaaS such as Heroku or Render. Like them, it aims to be a universal platform that builds, deploys, runs, and manages your apps for you, be it a tiny project in development or a large one in production.
With Zerops, you have a wide array of options when it comes to what you can run. You can opt for anything from a simple static web server to several runtimes for different programming languages backed up by various database management systems and other storage systems.
Getting back to our “Hello world” example
To simplify matters we are omitting any extra steps such as connecting to GitHub and only focusing on the first steps. However, to increase the level a bit, we will take a look at two possible scenarios:
- Using a static web server
- Using a Node.js runtime
In both cases we assume that you already have a Zerops account and an installed zCLI (Zerops command line tool) with proper authentication set up. Please note that you could use any other runtime like for Golang or PHP.
"Hello world" – the simplest way
- Create your
index.html
file with the following content:
<!DOCTYPE html>
<html>
<body>
<h1>Hello world from Zerops!</h1>
</body>
</html>
Login to Zerops GUI, create a new
Hello world
project and add theStatic server
service with the chosen hostnamestaticserver0
.Then simply deploy your file using the zCLI command:
zcli deploy "Hello world" staticserver0 index.html
- Enable Zerops subdomain access via
Public access & internal ports
on thestaticserver0
service and invoke the pre-generated URL in your browser.
Et voilà.
"Hello world" – still a simple way using Node.js
- Create your
index.js
file with the following content:
const http = require('http')
const requestHandler = (request, response) => {
response.end('Hello world from Zerops!')
}
const server = http.createServer(requestHandler)
server.listen(3000);
- For Zerops to know how to start the application, please create a
zerops.yml
configuration file next to it:
nodejs0:
build:
build: []
run:
start: node index.js
Login to Zerops GUI and create a new
Hello world (js)
project and add theNode.js
service with the chosen hostnamenodejs0
.Then simply deploy your file using the zCLI command:
zcli deploy "Hello world (js)" nodejs0 index.js
- Enable Zerops subdomain access via
Public access & internal ports
on thenodejs0
service and invoke the pre-generated URL in your browser.
All done! Congrats.
Summing things up
We went through the basic steps of deploying an application to Zerops. You could see how simple it was. As you may have noticed from the sample zerops.yml
files, on Zerops, you can take complete control of the building, deploying, and running of your code.
Coming up: more in-depth articles on how to make the most of Zerops.
Top comments (0)