Controller
The controller plugin is the base for all other included plugins. All plugins mark @sdr/controller
as an explicit dependency, so it is not neccesary to include it in your configuration file. It defines the following directives.
Install
- Yarn
- npm
yarn add @sdr/controller
Code Generation
This plugin does not emit any code.
Directives
controller
Add this to your top level types. This is how you group your web requests. Once you decorate your type with this it must only contain methods, not fields. The methods must be decorated with request
.
Options | Description |
---|---|
path | The path for this grouping of requests |
request
Add this to the methods within a controller
. It defines your web requests.
Options | Description |
---|---|
path | The path for request |
method | The REST method for this request. Allowed values are GET , POST , PUT , DELETE . |
model
Add this to the types
, unions
, enums
, inputs
, and interfaces
that you wish to emit typescript
code for.
Dependencies
None