Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewcook/nodejs-data-store
A simple data store written in Node
https://github.com/drewcook/nodejs-data-store
Last synced: 5 days ago
JSON representation
A simple data store written in Node
- Host: GitHub
- URL: https://github.com/drewcook/nodejs-data-store
- Owner: drewcook
- Created: 2022-05-16T00:26:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-16T00:33:55.000Z (over 2 years ago)
- Last Synced: 2024-04-10T10:01:13.555Z (9 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Data Storage API (Node.js) :turtle::rocket:
* This data store is a small HTTP service in Node.js to store objects organized by repository.
* Clients of this service should be able to `GET`, `PUT`, and `DELETE` objects.
* The service will identify objects by their content. This means that two objects with the same content should be considered identical, and only one such object should be stored per repository. Objects with the same content can exist in different repositories.
* The service should implement the API as described below.## API
### Upload an Object
```
PUT /data/{repository}
```#### Response
```
Status: 201 Created
{
"oid": "2845f5a412dbdfacf95193f296dd0f5b2a16920da5a7ffa4c5832f223b03de96",
"size": 1234
}
```### Download an Object
```
GET /data/{repository}/{objectID}
```#### Response
```
Status: 200 OK
{object data}
```Objects that are not on the server will return a `404 Not Found`.
### Delete an Object
```
DELETE /data/{repository}/{objectID}
```#### Response
```
Status: 200 OK
```## Getting started and Testing
This service requires a recent version of Node.js. Get started by installing dependencies:
```sh
npm install
```Then run the tests:
```sh
npm test
```Or run them continuously as you work:
```sh
npm run test-watch
```