You will need:
- Node.js above version 6.2.1
- A live Mongo installation with a database
- Your database URI
Clone this repository into its host directory, enter the main directory, and then install dependencies.
yourProjectsDirectory$ git clone git@github.com:pretentiousgit/item-ratings-api.git
yourProjectsDirectory$ cd item-ratings-api
yourProjectsDirectory$ npm install
to install package dependencies.
-
Node is out of date
- Check your version with
node -v
. If it is less than 6.2.1, try to update. - install
http://brew.sh
, or update brew usingbrew update
, and runbrew upgrade node
- Check your version with
-
Your NPM isn't installing all dependencies with a single go-round
- Remove node-modules and reinstall all your node-modules.
- hot tip:
npm install && say i am done hal
-
Mongo is not presently running on your system
- Is mongoDB installed? If not, install it using
brew install mongo
- If it is, try typing
mongod
at terminal
- Is mongoDB installed? If not, install it using
- In
database_info:
, enter your database connection string - something likemongodb://127.0.0.1/ObjectDB
- Rename
secretStub.js
tosecrets.js
, and generate an app secret for your application. Ideally, your secret will be something like 64 to 128 characters that are really, really random. This is basically a password so that if you later do some sort of authentication, which is not present in this demo, you can encode it with reasonable confidence it is mostly secure.
Run the app from the main directory using node server.js
Tests can be found in the /test
directory
Test the app using the command npm test
Completed and successful tests will generate their own documentation.
If your tests pass, this app will generate its own documentation automatically. You can find those docs with the server running. They will be located at:
http://yourURL/docs/
For a demo on a local machine, this means you'll find your docs at
http://127.0.0.1:8081/docs/
This API has a 404 message defined, which can be replaced by a JSON message or static HTML page.