1.0.47 • Published 4 years ago

@kobotech/core-http v1.0.47

Weekly downloads
39
License
ISC
Repository
bitbucket
Last release
4 years ago

Kobo360 Core Http Library

This library provides utilities for handing http requests and responses.

Usage

Add the dependency to this library in your project's package.json in the dependencies section;

{
  "dependencies": {
    "@kobotech/core-http": "1.0.0"
  }
}

Run npm install to install the defined dependencies;

To use the library in your project.

const coreHttp = require("@kobotech/core-http");

Respond with an error message

const data = "content";
const errorMessage = "error";
const httpStatus = 401;
coreHttp.sendErrorJsonResponse(response, data, errorMessage, httpStatus);

this call will write on the response object a json payload as seen below;

{ "success": false, "message": error, "data": "content" }

The data could be any type, whether string or array or even an object as long as it's supported by json.

1.0.47

4 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.38

5 years ago

1.0.40

5 years ago

1.0.31

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago