Skip to content
This repository has been archived by the owner on Aug 10, 2018. It is now read-only.

Added mongodb database #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

ckucera3
Copy link

@ckucera3 ckucera3 commented Dec 6, 2015

Added Database and Database Queries

I added a mongodb database. The URL in the code is for a database that I have running in the cloud server of https://mongolab.com. The app assumes that the database used has a collection called courses which contains documents of the following structure:

{
  "subject": "ACCT",
  "number": "2101",
  "description": "Short description.",
  "name": "Accounting I"
}

To access this data from the database, use the same queries used for the static info, with the following change to the route:

/api/db/course/...

For example, api/db/course/ACCT/2101

// view setup
//other middleware setup
// set up mongodb
var uri = "mongodb://test:[email protected]:45464/courses-backend";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be done as configuration either as an env variable or in a file that isn't committed. Note that there are bots that watch github for this kind of thing in order to hijack accounts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants