-
Notifications
You must be signed in to change notification settings - Fork 398
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
fix: routes from imported controllers via directory return 404 in 0.10.0 #980
Comments
Does not found mean it returns 404 or the modules themselves are not found when starting the app? |
All routes return 404. I've updated the issue to reflect that correctly. |
Could you please provide a bit more info? I cannot reproduce this locally. |
I'm tring with this snippet: import {createKoaServer} from "routing-controllers";
import {join} from 'path';
const axios = require('axios');
const application = createKoaServer( {
controllers: [join(__dirname, '/controllers/*.*s')],
middlewares: []
});
application.listen(4200);
axios.get('http://localhost:4200/api/first').then((resp: any) => {
console.log(resp);
}); |
Are you on windows ? |
Still does not work on Windows after fix #994 |
Have you tried locally? This is not released yet I guess. |
Oh sorry, I thought it was in 0.10.1 release. My bad |
Should be released. Please close this issue if it works for you or add a comment if not. |
Closing as complete, please reopen if you find an issue. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
It seems that using the directory-based import as described in the documentation does not work after upgrading to v0.10.0. Falling back to directly registering each controller works as intended. This applies when setting both, controllers and middleware.
Minimal code-snippet showcasing the problem
Expected behavior
Should keep working as it did in v0.9.0.
Actual behavior
All routes associated with registered controllers return 404 and middleware is ignored.
The text was updated successfully, but these errors were encountered: