You will be able to define a parameter schema to validate your input data and consume objects registered by services and middlewares.
Definition
title
Stores the API title.
This value can be reused by others.
params
Defines the input parameter scheme of the API.
Parameters are validated on the client and on the server, and the schema can be reused after the function is created.
If the parameters are not valid, the remote request will not be made and an error will be thrown.
self
Consumes dependencies registered in the IoC context so that they can be used internally by the function.
By default there are a number of registered objects available:
cache
Temporarily saves the request and response to avoid unnecessary multiple calls.
Internally calls the query function from @solidjs/router
.
create
Create the API function with the configured parameters and instance.
Examples
Simple server execution
Params validation