0.2.0 • Published 1 year ago

tr-apisrv v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

API Server

This is a simple API server providing with ability to easily create JSON API servers. Accepts also calls in www-form-urlencoded form and treats them identically to flat JSON key-value structure.

const ApiSrv = require('tr-apisrv');

var srv = new ApiSrv({ port: 8808,
                       address: '127.0.0.1',
                       callback: cb,
                       authCallback: authCb,
                       prettyPrintJsonResponses: true,
                       bodyReadTimeoutMs: 5000,
                       debug: true });

async function authCb(r) {
    return true;
}

async function cb(r) {
    var res = r.res;
    delete r.res;
    r.jsonResponse(r, 200);
}

Author

Timo J. Rinne tri@iki.fi

License

MIT License

0.2.0

1 year ago

0.1.4

1 year ago

0.1.5

1 year ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.2

4 years ago

0.0.1

4 years ago