addressbook-rest

2.0.7 • Public • Published

A simple array based REST service for address book apps

Installing:

npm install --save addressbook-rest

Using:

Create a file server.js under the project folder (along side package.json)

Simplest code to start the REST service at port 8080 with a base url "/api/":

require("addressbook-rest").start();

Customization of port and base url prefix:

var server = require("addressbook-rest");
var port = 9999;
var baseUrl = "api";

server.start({ port, baseUrl }, ()=>{ 
	console.log(`Server is running at http://localhost:${port}/${baseUrl}/contacts`)
});

Accessing:

Visit http://localhost:9999/api/contacts using a browser (or a REST client)

Package Sidebar

Install

npm i addressbook-rest

Weekly Downloads

1

Version

2.0.7

License

MIT

Last publish

Collaborators

  • kayartayavinod