apiss

1.2.0 • Public • Published

APISS

Application programming interface service server. A server-less-ish styled handler for multiple domains.

Notes

vhosts can be accessed by sub-domain and dropping the periods or by the domain its self (curl -H 'Host: test.com' localhost:8080)

Example

const Path = require('path');
const Apiss = require('apiss');

const server = new Apiss({
	path: Path.join(__dirname, 'vhosts')
});

await server.open();

console.log(`uri: ${server.server.info.uri}`);
console.log(`address: ${server.server.info.address}`);

API

new Apiss(options)

  • port: Number (Default: 0)
  • host: String (Default: localhost)
  • instances: Number (Default: Os.cups().length)
  • path: String (Default: ./vhosts) Path to a folder containing folders which contain an index.js file with an array of exported Hapi.js route objects. The virtual host and cors origin is set for each folder based on the folder name.

Apiss.open()

Apiss.close()

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i apiss

    Weekly Downloads

    2

    Version

    1.2.0

    License

    SEE LICENSE IN LICENSE

    Unpacked Size

    5.62 kB

    Total Files

    10

    Last publish

    Collaborators

    • xeaone