JavaScript / TypeScript Library

This example code allows you to perform database operations with the PxServ project. The following operations are supported:

  • Save data to the database

  • Toggle data between 0 and 1 in the database

  • Read data from the database

  • Delete data from the database

Requirements

Before using this example, ensure the following libraries are installed:

  • pxserv: Used to communicate with the PxServ API.

Installation

You can install the PxServ library using npm:

npm install pxserv

Connection Settings

Enter your PxServ API key and optionally the base URL in the following fields:

JavaScript

TypeScript

Usage

Add this code to your project and run it after installing the required libraries. The code will perform data addition, reading, and deletion operations with the PxServ API.

Sample Outputs

Below are example outputs you may see in the console:

These outputs indicate that the data has been successfully added, read, and deleted.

Last updated

Was this helpful?