Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/veritem/lil-demo
https://github.com/veritem/lil-demo
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/veritem/lil-demo
- Owner: veritem
- Created: 2024-11-26T18:35:16.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-26T22:02:05.000Z (about 1 month ago)
- Last Synced: 2024-11-26T23:18:56.399Z (about 1 month ago)
- Language: TypeScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
this projects assumes you have [nodejs](https://nodejs.org/en) setup on your system. Go a head and run:
```
npm install
npm run dev
``````
open http://localhost:8000
``````sh
curl -X POST http://localhost:8000/add -H "Content-Type: application/json" -d '{"payer": "DANNON", "points": 300, "timestamp": "2022-10-31T10:00:00Z"}'curl -X POST http://localhost:8000/add -H "Content-Type: application/json" -d '{"payer": "UNILEVER", "points": 200, "timestamp": "2022-10-31T11:00:00Z"}'
curl -X POST http://localhost:8000/add -H "Content-Type: application/json" -d '{"payer": "DANNON", "points": -200, "timestamp": "2022-10-31T15:00:00Z"}'
curl -X POST http://localhost:8000/add -H "Content-Type: application/json" -d '{"payer": "MILLER COORS", "points": 10000, "timestamp": "2022-11-01T14:00:00Z"}'
curl -X POST http://localhost:8000/add -H "Content-Type: application/json" -d '{"payer": "DANNON", "points": 1000, "timestamp": "2022-11-02T14:00:00Z"}'
``````sh
curl http://localhost:8000/balance
```PS: avoid reloading the server between api calls as I'm using an in memory datastructure for storage.