1.0.1 • Published 6 months ago

@sswahn/server v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Server · License npm version Weekly Downloads

A simple, robust, and extendable server utility for performing HTTP requests and streamlining CRUD operations.

Features

  • Concise methods for GET, POST, PUT, and DELETE requests.
  • Built-in type checking for better error handling.
  • Customizable headers for each request.
  • Simplified JSON responses.

Installation

Using npm:

npm install @sswahn/server

Usage

Import Server

import server from '@sswahn/server'

Get Request

const response = await server.get(api)

Post Request

const response = await server.post(api, request)

Put Request

const response = await server.put(api, request)

Delete Request

const response = await server.delete(api)

Custom Headers

For any request, you can provide custom headers:

const customHeaders = {
  'Authorization': 'Bearer YOUR_TOKEN'
}
server.get(api, customHeaders)

License

Server is MIT Licensed

1.0.1

6 months ago

1.0.0

6 months ago

1.0.0-beta.7

6 months ago

1.0.0-beta.6

6 months ago

1.0.0-beta.5

6 months ago

1.0.0-beta.4

7 months ago

1.0.0-beta.3

7 months ago

1.0.0-beta.2

7 months ago

1.0.0-beta.1

7 months ago

1.0.0-beta.0

7 months ago