Transform (almost) any npm module into a web service.
git clone git@github.com:kr1sp1n/service-npm-module.git
cd service-npm-module
npm install
npm start
The default npm module is lodash
but you can override it via
the env var NPM_MODULE
. See src/config.js
.
The idea is to do a POST /:moduleName/:functionName
like POST /lodash/upperCase
and
the request body should be an array of arguments that will be
applied via moduleName[functionName].apply(null, req.body)
.
The response looks like this:
{
"moduleName": "lodash",
"functionName": "upperCase",
"arguments": [
"hello world"
],
"result": "HELLO WORLD"
}