http-rest-api
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Http Rest Api

Simple and type-safe developer oriented rest api server for Node.js.

const { HttpServer } = require("http-rest-api")
const server = new HttpServer(3000)

const api = new HttpRestApi({
	method: "get",
	path: "/",
	handler: () => {
		return { message: "Hello World" }
	},
})

server.registerRestApis([api])
server.listen()

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. version 14.0 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

npm install http-rest-api

You can also install by yarn:

yarn add http-rest-api

Features

  • Built on top of express which gives all the flexibility, performance and robustness
  • Express middleware support
  • Built in typescript declarations
  • Very easy and flexible to create apis
  • Custom http errors

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Dependencies (1)

Dev Dependencies (4)

Package Sidebar

Install

npm i http-rest-api

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

19.4 kB

Total Files

17

Last publish

Collaborators

  • kunalgosrani