Skip to content

carrot/carrot-u-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

carrot-u-api

A very basic but thoroughly documented Express API for use in Carrot U API classes.

The stack

  • MongoDB, a NoSQL database.
  • Node.js, a super-speedy environment for writing web applications in JavaScript.
    • npm, the Node.js package manager.
    • Express, a web framework for Node.
    • Mongoose, a MongoDB framework for Node.

The structure

├── README.md
├── lib
│   ├── candy.js    The Mongoose `model` for Candy.
│   └── index.js    The script run on `start`; includes the routes
                    and starts the server at the specified port.
└── package.json    The metadata used by npm; includes project
                    dependencies and a `start` script.

Installation

  1. Ensure you have the following prerequisite software installed:
  • Node.js: To see if Node.js is installed, run node -v; if a version number is returned, you're all set.
  • MongoDB: To see if MongoDB is installed, run mongod --version; if a version number is returned, you're all set.

If either package is missing, install them via Homebrew, an OS X package manager. To be sure Homebrew is installed, run brew -v; if a version number is returned, you're all set. If the command isn't found, install Homebrew with the following command:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then, install your missing dependencies and follow the instructions output by Homebrew to ensure the software is started now and on login:

  • Node.js:

    brew install node
    
  • MongoDB:

    brew install mongo
    
  1. Change into the directory you'd like to clone the project to. For example:

    cd ~/Documents
  2. Clone the repository:

    git clone git@github.com:carrot/carrot-u-api
  3. Change into the cloned repository:

    cd carrot-u-api
  4. Start the server:

    npm start

Usage

The incredible Amanda Yang (@cutecreep) wrote a Python script for manipulating the API's public instance (carrot-u-api.herokuapp.com). It's located here and includes a README, too!

About

A simple Express API for use in Carrot U API classes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published