this project is based on the edge network that mongodb offers with a free tier to host your document based database.
-
Make an
.env
file in the project root. -
Copy this configuration and paste it in the
.env
file.AUTH_KEY=your_static_secret_key
-
Run
$ npm i --include=dev && npm run dev;
to install the dependencies and starts the dev server with hot reloading.
npm run build
curl -X POST http://localhost:8080/api/kv/table/mytable \
-H "Bearer: <YOUR_AUTH_KEY>"
curl -X DELETE http://localhost:8080/api/kv/table/mytable \
-H "Bearer: <YOUR_AUTH_KEY>"
curl -X GET http://localhost:8080/api/kv/mytable \
-H "Bearer: <YOUR_AUTH_KEY>"
curl -X POST http://localhost:8080/api/kv/mytable/mykey \
-H "Content-Type: application/json" -H "Bearer: <YOUR_AUTH_KEY>" -d '{"value":"some value"}'
curl -X GET http://localhost:8080/api/kv/mytable/mykey \
-H "Bearer: <YOUR_AUTH_KEY>"
curl -X PUT http://localhost:8080/api/kv/mytable/mykey \
-H "Content-Type: application/json" \
-H "Bearer: <YOUR_AUTH_KEY>" -d '{"value":"new value"}'
curl -X DELETE http://localhost:8080/api/kv/mytable/mykey \
-H "Bearer: <YOUR_AUTH_KEY>"
Signed by Dave.