Server for our class fictional company. We will be adding an API to our backend database, Postgres.
- Install Node.js
- on OSX use homebrew
brew install node
- on Windows use chocolatey
choco install nodejs
-
Install Postgres from https://www.postgresql.org
-
Install pgAdmin from https://www.pgadmin.org
-
Download or Clone the repository into a project folder.
-
From a command line / terminal, cd into the project folder.
-
Install dependencies
npm install
We have 2 separate node apps in this setup. One is our web server, and the other will act as an API server that will be accessible to our own web pages, mobile apps and external customers who may want access to our data.
NOTE: When running the web_server.js, you will need admin / root privlidges due to the port number being 80.
-
From a command line / terminal, cd into the project folder then run the web server with:
node web_server.js
-
From a seperate command line / terminal, cd into the project folder then run the api server with:
node api_server.js
-
Open a browser and go to http://localhost for the default home page (we are working on that) or http://localhost/admin for the administrator pages.