This is a basic Node.js HTTP server that provides key-value store functionality. The server allows you to create, retrieve, store, update, and delete data using simple HTTP requests.
- Install the vx.x.x-xdb.bun.js file
- Run the file in
NOTE: ALL THE ENDPOINTS USE GET REQUESTS
/new?id={fileId}
Creates a new JSON file in the specified directory (see Configuration).
/{fileId}/get/?id={key}
Retrieves the value associated with the specified key from the JSON file.
/{fileId}/store/?id={key}&data={value}
Stores the provided key-value pair in the JSON file.
/{fileId}/patch/?id={key}&data={value}
Updates the value associated with the specified key in the JSON file.
GET /{fileId}/delete/?id={key}
Deletes the key-value pair with the specified key from the JSON file.
-
PORT
: The port on which the server listens (default is 9052). -
DIR
: The directory where JSON files are stored (default is 'db').
xdb v1.0.0