To do that, open the terminal and run this command:
sudo npm install -g zinky-cli
In the terminal, navigate to the folder where you want to put your website, and run this command
zinky -a appname
You will note that a new folder named "appname" was created containing our newly generated app.
Navigate into it:
cd appname
And install its npm dependencies, by running this command:
npm install
At the moment, the app has not yet any module, so we'll generate one called home that will handle our application home page.To perform this, run this zinky-cli command:
zinky -M home
You will see the new module's folder in "app_modules" folder.
One last thing we have to do before we'll be able to see the Hello World is to tell our homemodule to display this message.
Open app_modules/home/index.js and add the following line to GET_root method:
res.end('Hello World');
So the file will look like:
const Zinko = require('zinko');
class Home extends Zinko {
GET_root(req, res) {
res.end('Hello World');
}
}
module.exports = Home;
We can now check the result.
Start the app by running:
node app.js
And visit localhost:3000/home/ using your browser then enjoy the result!