Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.3 KB

File metadata and controls

34 lines (24 loc) · 1.3 KB

Introduction

This is the API provider for the VIAplanner frontend. It handles database population and content serving to clients.

Installation Using NPM

git clone https://github.com/VIAplanner/via-api
cd via-api
npm install
npm run dev

Populating The Database Using NPM

  1. Ensure that you have placed the following files (generated from the scraper ):

    1. courses.json - Data for all offered courses in all currently offered sessions
    2. divisional.json - Divisional data such as HTML legends, and enrolment indicator data
    3. reference.json - Reference data such as more information on the currently offered sessions and their subsessions and all the divisions that are offering courses
    4. misc.json - Other miscellaneous data
  2. Run the following command to automatically clear the old database data and populate it with the new data

npm run populate

.env Setup

MONGODB_LOCAL_URI

MONGODB_URI: A link to the mongodb database targeted for production, for example "mongodb://localhost:27017/via-api-dev"

NODE_ENV: Either 'development' or 'production', used to loosen/enforce CORs restrictions

PORT: The port that the backend should deploy on, defaulted to 3000 if not provided