We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I don't want to use a lot of nesting add returning new instance in group & guard if not callback run param
I want it to work like this
import { Elysia, t } from 'elysia'; import { swagger } from '@elysiajs/swagger'; // default scope (guard return new instance) const router = new Elysia().guard({ type: 'application/json', detail: { tags: ['Public'], }, headers: t.Object({ 'x-device-id': t.String(), }), cookie: t.Cookie({ at: t.String() }), response: { 401: t.Object({ code: t.String(), }), }, }); // links scope (group return new instance ) const links = router .group('/links', { beforeHandle: [ (r) => { console.log(r); }, ], }) .get('/', () => ''); const catalog = router .group('/catalog') .get('/', () => []) .get('/:productId', () => ({})); const publicApi = new Elysia() .use(links) .use(catalog) const app = new Elysia({ prefix: '/api' }).use(setup).use(publicApi);
This solution helps to use a more flexible composition
No response
The text was updated successfully, but these errors were encountered:
This feature is very useful. Any Update on this?
Sorry, something went wrong.
No branches or pull requests
What is the problem this feature would solve?
I don't want to use a lot of nesting
add returning new instance in group & guard if not callback run param
I want it to work like this
What is the feature you are proposing to solve the problem?
This solution helps to use a more flexible composition
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: