serverifier
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Serverifier

A library to use server functions inside a client application.

Installation

To install the library, use npm:

npm install serverifier@latest

Usage

const Serverifier = require("serverifier");
// initialize the server
Serverifier.init();

// Set a route with sample data
Serverifier.setRoute("/api/sample", { message: "Hello, world!" });

API



init(port, route)

Initialize the server with an optional port (default is 3000) and an optional base route (default is '/').
Serverifier.init(4000, "/app");

setRoute(api, data)

Set a route with the specified API endpoint and response data.
Serverifier.setRoute("/api/custom", { custom: "data" });

License



This project is licensed under the MIT License - see the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i serverifier

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

5.21 kB

Total Files

6

Last publish

Collaborators

  • ibrahimkhan