Skip to content

fix: routes from imported controllers via directory return 404 in 0.10.0 #980

@dbrewer5

Description

@dbrewer5

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

import { createKoaServer } from 'routing-controllers'
import { join } from 'path'

const app = createKoaServer({
    controllers: [join(__dirname, '/controllers/*.*s')],
    middleware: [join(__dirname, '/middleware/*.*s')]
})

app.listen(3000) // all routes will return 404 and middleware will be ignored

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions