Skip to content

pmacik/nodejs-rest-http-crud

This branch is 12 commits ahead of, 48 commits behind nodeshift-starters/nodejs-rest-http-crud:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7dbb28c Â· Sep 22, 2021
Jul 3, 2019
Aug 7, 2019
Apr 23, 2018
Aug 30, 2019
Aug 7, 2019
Jul 24, 2019
May 7, 2018
Aug 16, 2017
Sep 20, 2018
Aug 7, 2019
Sep 22, 2021
Jul 9, 2019
Aug 14, 2017
Jul 9, 2019
Feb 13, 2019
Aug 7, 2019
Aug 7, 2019
Nov 12, 2018
Jul 9, 2019

Repository files navigation

Build Status Coverage Status Greenkeeper badge

Example CRUD Application

Getting Started

Running Locally

First, install the dependencies

npm install

A Postgres DB is needed, so if you are using Docker, then you can start a postgres db easily.

docker run --name os-postgres-db -e POSTGRESQL_USER=luke -e POSTGRESQL_PASSWORD=secret -e POSTGRESQL_DATABASE=my_data -d -p 5432:5432 centos/postgresql-10-centos7

In this example, the db user is luke, the password is secret and the database is my_data

You can then start the application like this:

DB_USERNAME=luke DB_PASSWORD=secret ./bin/www

Then go to http://localhost:3000

Running on Minishift

First, make sure you have minishift setup and are logged in using oc login.

Then create a new project using the oc commands

oc new-project fun-node-fun

For this example, you will also need a postgres db running on your Minishift cluster.

oc new-app -e POSTGRESQL_USER=luke -ePOSTGRESQL_PASSWORD=secret -ePOSTGRESQL_DATABASE=my_data centos/postgresql-10-centos7 --name=my-database

Then run npm run openshift to deploy your app

Then you can navigate to the newly exposed route, something similar to "http://nodejs-rest-http-crud-boosters.192.168.99.100.nip.io/", this will probably be different based on your Minishift IP address

About

Example CRUD for nodejs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 83.0%
  • HTML 15.7%
  • Other 1.3%