https://github.com/redhat-developer-demos/namegen
Node.js and MongoDB demo code
https://github.com/redhat-developer-demos/namegen
Last synced: 2 months ago
JSON representation
Node.js and MongoDB demo code
- Host: GitHub
- URL: https://github.com/redhat-developer-demos/namegen
- Owner: redhat-developer-demos
- License: mit
- Created: 2022-09-26T16:37:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T20:49:22.000Z (7 months ago)
- Last Synced: 2025-03-29T09:22:10.501Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 70.3 KB
- Stars: 3
- Watchers: 7
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# random-name-gen-app
A demonstration project that has an API backend that binds to an instance of a MongoDB database and an HTML front end, all running from the same code base. The behavior of the UI is that it generates and stores a random name according to a series of button clicks.## Get up and running
`Step 1:` Get the code:
`git clone https://github.com/reselbob/random-name-gen-app.git`
---
`Step 2:` Add an entry to `.env`:
`MONGODB_URL=`
---
`Step 3:` Install the dependencies:
`npm install`
---
`Step 4:` Start the server:
`node server.js`
By default, the app runs on port `8080`
To change the port on which the web server is listening, add the following to the `.env` file in the root of the project's working directory:
`SERVER_PORT=`
WHERE
`` is the number of the port for the web server.
---
`Step 5:` Access the front-end web page:
`http://localhost:8080/`
