- Globally Available
- Lowest Latancy
- Serverless
- Rest API
- Token Based Authenticated Request Support
- Request:
Method: POST
Content-Type: application/json
URL (Secured with Token): https://<your-app>.workers.dev/?key=<key>
URL (Not Secured): https://<your-app>.workers.dev/
BODY: Json Data (Not Parsed)
- Response:
{
"status": true,
"_id": "16125252787azq",
"query": "https://<your-app>.workers.dev/16125252787azq",
"data": {
"i_am": "writing a readme"
}
}
- Set an ID manually:
Send this ๐
"_id":"my-unique-id"
with Body
- Bash example
curl -X POST 'https://example.example.workers.dev/?key=examplekey' \
-d '{"_id":"example","value": "example"}' \
-H "Content-Type: application/json"
- Request:
Method: GET
URL: https://<your-app>.workers.dev/<_id>?key=<key>
- Response:
{
"status": true,
"_id": "16125252787azq",
"data": {
"i_am": "writing a readme"
}
}
- Bash example
curl 'https://example.example.workers.dev/example?key=examplekey'
- Request:
Method: DELETE
URL (Secured with Token): https://<your-app>.workers.dev/<_id>?key=<key>
URL (Not Secured): https://<your-app>.workers.dev/<_id>
- Response:
{
"status": true,
"msg": "Deleted Successfully"
}
- Bash example
curl -X DELETE 'https://example.example.workers.dev/example?key=examplekey'
- Open Cloudflare Worker Page
- Click on KV
- In
Namespace Name
section Type a Name & Click onAdd
, a namespace will created. - Now click on Workers & Create a worker
- Copy the code of
worker.js
, paste into Worker & Click on Save & Deploy - Now go back to worker main page, here you will see that your created worker listed there, click on that.
- Click on
Settings
- In
KV Namespace Bindings
section click onAdd Binding
- Write
JSONBASE
in Variable name & select your recently created Namespace for KV namespace. - You just made your Cloudflare DB, Now Read the API Endpoint and use it in your Project ๐ช
You can impliment token based authentication system for requests
- Write your key in
KEY
&GETKEY
to secure requests with a Token (Line No: 2, 5)
Kanging will not make you a developer. So, don't be a kanger โ
- This Project is Apache-2.0 Licensed
- Copyright 2021 by Tuhin Kanti Pal