In Loopback4 REST Endpoints/Operations like "GET /greet" are mapped/configured with a Decorator above the method that processes the query and returns the result:
@get('/greet', spec)
greet(name: string) {return "hello"}
I am completely new to Loopback and Typescript. My question is how do such configuration Decorators work in general (also in other frameworks)?
Some Detailed Questions:
Thanks very much!
They are evaluated at build-time and require the experimentalDecorators: true
setting in tsconfig.json
to enable them.
The TypeScript docs cover them well here: https://www.typescriptlang.org/docs/handbook/decorators.html