1.2.3 • Published 12 months ago

empathy-api-handler v1.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Installation

Current Version - v1.2.3

npm i empathy-api-handler

Usage

create a 'handler.ts' to initialize the class and export it;

import { ApiHandler } from 'empathy-api-handler';

const basePath = "http://localhost:3333/api";

export const apiHandler = new ApiHandler(basePath);

now when using in other files you can import and use it with your instance:

import { apiHandler } from "./handler";

const route: string = "/login";
const payload: Object = {
    email: "test@email.com",
    password: "test123",
};
const response = await apiHandler.POST({ route, payload });

OPTIONS

These are the default options:

{
  route: string;
  payload: Payload;
  cookie?: string;
  credentials?: RequestCredentials; // "include" | "same-origin" | "omit"
  return_json?: boolean;
}
1.2.3

12 months ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago