Functions-IO
FaaS Micro Framework
work in progress...
Minimalist FaaS framework for node.
Features
- Focus on high performance
- Input/Output with automatic validation
- Openapi/Swagger definition generated automatically
Installation
$ npm install functions-io
Usage
Create a subfolder in functions folder and generate package.json
$ npm init
example package.json
create file index.js
moduleinput = x:type:"integer" required:true y:type:"integer" required:true;moduleoutput = value:type:"integer"; module{ ;};
Start Server
var functionsio = ;var app = ; app;
swagger.json
http://localhost:8080/swagger.json
Catalog API (Openapi / Swagger)
http://localhost:8080/_admin/catalog
Admin
http://localhost:8080/_admin/stats
Test
http://localhost:8080/_admin/test
Options property
- path (default: functions)
- enableStatistics (default: true)
- enableSecurity (default: false)
- test
-
- load (default: true)
-
- executeOnStart (default: false)
- scan
-
- automatic (default: true)
-
- interval (default: 2000)
- cors
-
- enable (default: false)
-
- fromOrigin (default: *)
- html
-
- static (default: static)
- db
-
- provider (default: sys.db.provider.mongo)
- functions
-
- sys.db.provider.mongo
-
-
- db
-
-
-
-
- url (default: mongodb://localhost:27017/sample)
-
-
//examplevar functionsio = ;var app = ; app;
- example file config.json
- example file config.json
- example file config.json
- example file config.json
curl -XPOST http://localhost:8080 -H "content-type:application/json" -d '{"jsonrpc":"2.0","method":"security.login","params": {"email":"admin@admin.com", "password":"123"} }' -v
curl -XPOST http://localhost:8080 -H "content-type:application/json" -H "authorization:bearer " -d '{"jsonrpc":"2.0","scope":"functions-io-labs","method":"math.sum","version":"2.0.0","params": [2,4]}' -v