https://github.com/tarunbatra/portfolio-api
Sample API involving Portfolio, Trades, Stocks
https://github.com/tarunbatra/portfolio-api
Last synced: 4 months ago
JSON representation
Sample API involving Portfolio, Trades, Stocks
- Host: GitHub
- URL: https://github.com/tarunbatra/portfolio-api
- Owner: tarunbatra
- License: mit
- Created: 2017-07-23T19:57:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-23T20:33:15.000Z (about 8 years ago)
- Last Synced: 2025-03-01T19:26:38.989Z (7 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# portfolio-api
[![Heroku][heroku-image]][heroku-url]Sample API involving Portfolio, Trades, Stocks
## API
| Method | Route | Return |
|:--------|:-------------------|:-----------------------------------|
| GET | `/` | Return portfolio |
| GET | `/trades/:id` | Trade represented by `id` |
| GET | `/holdings` | Holdings at this point of time |
| POST | `/addTrade` | Add a trade |
| POST | `/updateTrade/:id` | Update a trade represented by `id` |
| POST | `/removeTrade/:id` | Remove a trade represented by `id` |## Environment Variables
| Variable | Default | Description |
|:-----------|:--------------------------------|:----------------------------------|
| PORT | `3000` | Port the server should listen to |
| MONGO_URL | `mongodb://localhost/portfolio` | Port the server should listen to |## Run
```js
npm start
```## Test
```js
npm test
```
[heroku-image]: https://heroku-badge.herokuapp.com/?app=port-folio-api
[heroku-url]: http://port-folio-api.herokuapp.com