0.2.0 • Published 2 years ago

tr-apisrv v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.1.4

2 years ago

0.1.5

2 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.2

5 years ago

0.0.1

5 years ago