Skip to content

redhat-developer-demos/namegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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=<connection_string_url_to_mongodb_server>


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=<port_number>

WHERE

<port_number> is the number of the port for the web server.


Step 5: Access the front-end web page:

http://localhost:8080/

1 40-05

About

Node.js and MongoDB demo code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published