Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.13 KB

README.md

File metadata and controls

53 lines (36 loc) · 1.13 KB

XDB

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.

Usage

  1. Install the vx.x.x-xdb.bun.js file
  2. Run the file in

Api

NOTE: ALL THE ENDPOINTS USE GET REQUESTS

1. Create a new file:

/new?id={fileId}

Creates a new JSON file in the specified directory (see Configuration).

2. Retrieve data:

/{fileId}/get/?id={key}

Retrieves the value associated with the specified key from the JSON file.

3. Store data:

/{fileId}/store/?id={key}&data={value}

Stores the provided key-value pair in the JSON file.

4. Update data (PATCH):

/{fileId}/patch/?id={key}&data={value}

Updates the value associated with the specified key in the JSON file.

5. Delete data:

GET /{fileId}/delete/?id={key}

Deletes the key-value pair with the specified key from the JSON file.

Configuration

  • 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