Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 1.8 KB

README.md

File metadata and controls

37 lines (31 loc) · 1.8 KB

VPatientAPI

API of Virtual Patient based on Express Node.js web application framework and MongoDB. Includes CI/CD integration powered by GitHub Self-Hosted Runners.

How to run

You can run the project as follows:

  1. Fork or clone the repository to your local. You can use the command below:
git clone https://github.com/VPatient/VPatientAPI
  1. Open any kind of terminal in the directory of the API:
cd VPatientAPI # assuming that you are currently out of the folder of the API
npm install # to install required libraries/packages
  1. In order to run project you are going to need a '.env' file which will be located in the folder of the API. Also if you are planning to use HTTPS then you are going to need cert.pem, chain.pem, fullchain.pem generated by CertBot. By default placing all of them into the root directory of the api should work fine but if you are willing to use CertBot auto-renew certificates (auto-generated .pem files) then change PRIVATE_LOCATION to folder given in installation of CertBot, as an example: 'C:\Certbot\live\api.vpatient.com'

rename 'example.env' to '.env' fill all variables in the given format

MONGO_DB_URL= # mongodb connect url
PORT=5000 # port that is going to be used
SECRET=ef28ed74551a40deba54b81df485c83a # password hashing secret
AUTH_SECRET=ef28ed74551a40deba54b81df485c83b # authorizing secret -> to get a user to be an authorized via auth/authorized route
GRADE_SECRET=ef28ed74551a40deba54b81df485c83c # grade secret -> to use grade/create route and save one grade to user
PRIVATE_LOCATION=. # absolute or relative path to .pem fiels -> to use SSL
HTTP_PORT=80 # port to set up http server
HTTPS_PORT=443 # port to set up http server
  1. You have to run:
npm start

After all these steps your API should be running on http://localhost and https://localhost