Lightweight API for storing, retrieving, and managing data along with automated versioning.
- Clone the repository:
git clone https://github.com/vixhnuchandran/Versix
cd Versix
delete my project 2. Install dependencies:
pnpm install
- Set up environment variables:
PORT=8484
- Build:
pnpm run build
- Start the server:
pnpm start
X-Api-Key: <apiKey>
-
URL:
/api/set-data
-
Method: POST
-
Description: Create and store data.
-
Request Body:
id
: Identifier for the record.name
: The name of the data source.data
: The data in JSON format.
{ "id" : <str: id>, "name" : <str: name> "data" : <obj: data> }
-
Response: Returns the Data added successfully, or an error message if unsuccessful.
-
URL:
/api/get-data
-
Method: POST
-
Description: Retrieves data.
-
Request Body:
id
: Identifier for the record.name
: The name of the data source.version (optional)
: The data in JSON format.
{ "id" : <str: id>, "name" : <str: name> "version" : <int: version> }
-
Response: Returns the requested data if found, or an error message if not found.
-
URL:
/api/has-data
-
Method: POST
-
Description: Check if data exist.
-
Request Body:
id
: Identifier for the record.name
: The name of the data source.
{ "id" : <str: id>, "name" : <str: name> }
-
Response: Returns the requested data if found, or an error message if not found.