/E-learning

rest api

Primary LanguageJavaScript

Elearning API

REST API for an Elearning website

NodeJS ExpressJS MongoDB

How to run

First, please make sure you have Node.js and MongoDB installed.
  1. navigate to the project folder
cd elearning
  1. install npm dependencies
npm i
  1. seed the database
npm run seed
  1. start the project
npm start

Documentaion

You can find the api documentation at Postman

Important notes

  • config.env file in project's root directory is used to store the configuration "env. variables"
  • In config.env, you can change NODE_ENV from development to production and vice versa
    • development: error details and stack is returned, also logs are logged to the console
    • production: production error version is returned, logs are logged to logs files
  • The api default url is localhost:8000/api/v1
    • Can be changed from config.env
  • This is a simple project aims to learn and practice, In real production application .env and .pem files shouldn't be added to the repo.
  • the command node utils/generatePublicAndPrivateKeys.js is used to generate '.pem' files in the jwt-keys folder under '/config'