Closed joshuaja-tangelo closed 10 months ago
Example should be updated to add a path string as an argument to the Get() decorator to avoid a type error:
path
Get()
import { Controller, Get, decorators } from "elysia-decorators"; import { Elysia } from "elysia"; // /users prefix @Controller("/users/") class UsersController { @Get("") index() { return "Hello World"; } } const app = new Elysia(); app.use( decorators({ controllers: [UsersController], }) ); app.listen(3000);
Additionally, the user will need to make sure to set "experimentalDecorators": true, in their tsconfig.json compilerOptions object to avoid a type error on the Controller() decorator argument.
"experimentalDecorators": true,
tsconfig.json
compilerOptions
Controller()
Fixed
Example should be updated to add a
path
string as an argument to theGet()
decorator to avoid a type error:Additionally, the user will need to make sure to set
"experimentalDecorators": true,
in theirtsconfig.json
compilerOptions
object to avoid a type error on theController()
decorator argument.