gorkem / node-application

Generated by the Red Hat Developer Launcher (https://developers.redhat.com/launch)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

REST API Level 0 - Node.js Booster

Important
This booster requires Node.js 8.x or greater and npm 5 or greater.
Important
As part of the process of creating this booster, developers.redhat.com/launch or the Fabric8 Launcher tool set up a project with a CI/CD deployment of this booster. You can see the status of this deployment in your Single-node OpenShift Cluster or OpenShift Online Web Console.

Runing the Booster Locally

To run this booster on your local host:

$ git clone git@github.com:gorkem/node-application

$ cd node-application

$ npm install && npm start

Interacting with the Booster Locally

To interact with your booster while it’s running locally, use the form at http://localhost:8080 or the curl command:

$ curl http://localhost:8080/api/greeting
{"content":"Hello, World!"}

$ curl http://localhost:8080/api/greeting?name=Sarah
{"content":"Hello, Sarah!"}

Updating the Booster

To update your booster:

  1. Stop your booster.

    Note
    To stop your running booster in a Linux or macOS terminal, use CTRL+C. In a Windows command prompt, you can use CTRL + Break(pause).
  2. Make your change (e.g. edit public/index.html).

  3. Restart your booster.

  4. Verify the change took effect.

Running the Booster on a Single-node OpenShift Cluster

If you have a single-node OpenShift cluster, such as Minishift or Red Hat Container Development Kit, installed and running, you can also deploy your booster there. A single-node OpenShift cluster provides you with access to a cloud environment that is similar to a production environment.

To deploy your booster to a running single-node OpenShift cluster:

$ oc login -u developer -p developer

$ oc new-project MY_PROJECT_NAME

$ npm install && npm run openshift

More Information

You can learn more about this booster and rest of the Node.js runtime in the Node.js Runtime Guide.

About

Generated by the Red Hat Developer Launcher (https://developers.redhat.com/launch)

License:Apache License 2.0


Languages

Language:JavaScript 69.6%Language:HTML 28.2%Language:CSS 2.2%