Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decodedco/acc-api
Simple account API
https://github.com/decodedco/acc-api
Last synced: 8 days ago
JSON representation
Simple account API
- Host: GitHub
- URL: https://github.com/decodedco/acc-api
- Owner: DecodedCo
- Created: 2013-09-12T10:33:50.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-18T15:55:41.000Z (about 11 years ago)
- Last Synced: 2024-11-19T23:47:21.842Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 660 KB
- Stars: 0
- Watchers: 8
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Simple Account API
##Requirements
* Node [http://nodejs.org/]()
* MongoDB [http://www.mongodb.org/]()##Installation
1. Git clone
2. In one terminal window/tab start Mongo DB server `mongod`
3. Install dependancies `npm install`
4. Install grunt cli globally `npm install -g grunt-cli`
5. Run the app and start asset compilation `grunt`The API should now be available at: [http://localhost:3000]()
##API calls:
Summary of calls:* `/account - POST`: Create account
* `/account - DELETE`: Delete account
* `/account/:id - GET`: Get account info
* `/account - GET`: Get all accounts
* `/account - PUT`: Update account info
* `/account/increment - POST`: Move account's date forward in time
* `/transaction - POST`: Add a transaction to an account
* `/transaction/:id/:type?/:date_start?/:date_end? - GET`: Get transactions for an account, optional filtering.All calls respond with JSON.
##Tests
There are some tests using Mocha, ExpectJS and Superagent. These make mock requests to the API and test for correct responses.Once the dependencies have been installed, run `mocha` in the project folder to run tests.
-----------------------------------
##Test Console
There is a test console that gives access to most of the API functionality here:
[http://localhost:3000/test]()##Example apps
* Sponsor: http://localhost:3000/test/sponsor.html
* Receiver: http://localhost:3000/test/receiver.html##Base JavaScript API wrapper
The JavaScript file `static/js/acc.js` provides an abstracted interface to the API.