Use the devfile specification to develop a Node.js “Hello World” application. Developing this application introduces you to how a devfile automates and simplifies your development process.
To make developing with the devfile specification easier, consider doing the following:
Install minikube to create a Kubernetes cluster on your local machine.
Download kubectl to access your namespace.
Enable ingress on minikube to access your devfile project.
Install the odo command line interface (CLI) tool to execute the devfile specification.
View the available devfiles:
$ odo catalog list components
Create a devfile project.
$ odo create nodejs _<name of your project>_ --starter
--starterparameter to include the starter project currently inside the Node.js devfile specification, which makes it easier for you to develop an application.
Find your cluster IP address.
$ minikube IP
Create an ingress inside your cluster that you can use to access your application using the cluster IP address.
$ odo url create _<name you give the url>_ --ingress --host _<IP address>_.nip.io
$ odo url create myfirstproject --ingress --host 192.168.64.2.nip.io
Build the URL.
$ odo push
- To verify that you built your Node.js "Hello World" application successfully, view the application in a web browser by copying and pasting the URL that was produced by running the
odo pushcommand. Go to the URL and view your "Hello World" application.
To continue working with devfiles, go to overview.