- Notifications
You must be signed in to change notification settings - Fork0
ddigitech/nodejs-ex
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Example CRUD Application
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 isluke, the password issecret and the database ismy_data
You can then start the application like this:
DB_USERNAME=luke DB_PASSWORD=secret ./bin/www
Then go tohttp://localhost:8080
Other options:
npm run devsame asnpm startbut with pretty output log.npm run dev:debugshows debug information.
First, make sure you have an instance of Openshift setup and are logged in usingoc login.
Then create a new project using theoc commands
oc new-project fun-node-fun
For this example, you will also need a postgres db running on your Openshift cluster.
oc new-app -e POSTGRESQL_USER=luke -ePOSTGRESQL_PASSWORD=secret -ePOSTGRESQL_DATABASE=my_data centos/postgresql-10-centos7 --name=my-database
Then runnpm run openshift to deploy your app
Run the following command to show the newly exposed route that you can navigate:
oc get route nodejs-rest-http-crudNAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARDnodejs-rest-http-crud nodejs-rest-http-crud-opentel.apps-crc.testing nodejs-rest-http-crud 8080 NoneAbout
node.js example
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- HTML55.0%
- JavaScript38.0%
- Python6.8%
- Makefile0.2%