Code Monkey home page Code Monkey logo

angularapp's Introduction

Build Status Note: mongod must be running in order for this app to work! In one terminal, use mongod --dbpath=./db --smallfiles where db is the name of a directory in your app's root directory. This is essential as it starts mongo and tells it where to store/reteive/edit/delete data from.

This app stores user posts of differnt beers in a mongo database. This is done by making a POST request to /api/beers. For example, using Superagent-CLI: superagent localhost:3000/api/beers post '{"name":"Leafer Madness","brewery":"Beer Valley","style":"double IPA","notes":"very tasty"}'

Then users can see a list of all the beers in the database (in json format) by making a GET request to /api/beers (such as using the browser).

Users can also modify the database with a PUT request to /api/beers/someID where someID is the id that mongo gives the item in the database. For example, using Superagent-CLI: superagent localhost:3000/api/beers/5643a0ce9cc8b7ba053de8e9" put'{"notes":"I'd like to have that again some time"}' would change the "notes" field from "very tasty" to "I'd like to have that again some time".

Users can delete an item from the database by making a DELETE requst to /api/beers/someID where someID is the mongo id of that particular beer. For example, using Superagent-CLI: ```superagent localhost:3000/api/beers/5643a0ce9cc8b7ba053de8e9 delete" would remove that same beer from the database entirely.

Additional features: The user can a SUBSET of all the beers in the database by simply making a GET request (i.e. use superagent or just the browser) to /api/beers/someBreweryName where someBreweryName is the name of the brewery that the user wants to see beers from. That route will display json data for all the beers from that one brewery, but not from any other brewery.

Finally, making a GET request to /someName will display a message using someName. For example, taking the browsewr to localhost3000:/matt will display "My name is MATT and I like me some beer."

angularapp's People

Contributors

craigaaroncampbell avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.