Copy the .env.example file to .env and provide the required data.
go build
./badger-db
Usage
Verb
Path
Description
GET
/
It provides information about the API and the Database.
GET
/items/:key
It returns the value for the given :key. Status 200 if it exists, 404 if not.
HEAD
/items/:key
Checks if the :key exists without returning its value. Status 204 if it exists, 404 if not.
PUT
/items/:key
It sets the value for the given :key. The value for the key should be sent in the request body as Plain Text. Status 201 if created, status 204 if updated.
DELETE
/items/:key
It deletes the value for the given :key. Status 204 if deleted, status 404 if it already doesn't exists.