Skip to content
New issue

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

feature: <how make sub folder controllers> how make sub folder controllers #1229

Open
khanhnam99 opened this issue Sep 22, 2023 · 2 comments
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.

Comments

@khanhnam99
Copy link

how make sub folder controllers

@khanhnam99 khanhnam99 added flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features. labels Sep 22, 2023
@angelxmoreno
Copy link
Contributor

What do you mean by sub folder controllers? Do you mean how to span controller methods across the same route paths?

import { Get, JsonController } from 'routing-controllers';

@JsonController('/images')
export class IndexController {
    @Get('/')
    async index() {
        return 'this is the images root';
    }
}

@JsonController('/images/products')
export class Index2Controller {
    @Get('/')
    async index() {
        return 'this is the images/products root';
    }
}

The above should match /images/ to IndexController and /images/products to Index2Controller.

If the above is not what you mean could you elaborate and provide an example ?

@angelxmoreno
Copy link
Contributor

@khanhnam99 please close this if your issue is resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.
Development

No branches or pull requests

2 participants