@dedaca/deda-core-rest-server
v2.0.2
Published
A DEDA Express REST API server that uses the DEDA.Validator and JSON to expose DEDA events to the REST API.
Downloads
1
Readme
HTTP REST Server
Context
request
- Express request.response
- Express response.next
- Express next function.schema
- The payload validation schemaroute
- The REST route details.args
- Express route argumentsparams
- URL parameterspayload
- The parsed and validated payload.token
- The header authentication bearer token.userToken
- The cookies ID token.error(payload, [statusCode])
- Returns error response.success(payload, [statusCode])
- Returns success response.
Route Schema
See schema.json for JSON schema validation and property description.
{
"api": {
"prefix": "",
"routes": [
{
"method": "string",
"path": "string",
"schema": "string",
"event": "string",
"permission": "string"
}
...
]
},
"schemas": {
"$refs": [
...
]
...
}
}