When working with Loopback4 REST Endpoints/Operations, such as "GET /greet," they are configured using a Decorator above the method that handles the query and returns the desired result:
@get('/greet', spec)
greet(name: string) {return "hello"}
As someone who is new to both Loopback and Typescript, I am curious about how these configuration Decorators function in a broader context (including other frameworks).
Here are some more specific questions I have:
- Are the decorators processed during the build phase, resulting in generated configuration code? Or are they only processed at runtime?
- If processing occurs at runtime, how does a decorator containing pre-configuration information work before it can even be triggered when the method is called? Is there a TypeScript function that retrieves an Array of all applied Decorators?
- ...
Thank you for your help!