Skip to content

Commit bafb0c1

Browse files
committed
update: move container binding for routes from 'routes' to 'app.routes'.
1 parent 8c78ff1 commit bafb0c1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/router/src/Commands/RouteListCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class RouteListCommand extends ConsoleCommand {
4242
/**
4343
* Sort the routes alphabetically
4444
*/
45-
const list = [...(this.app.make<any>('routes') as RouteDefinition[])].sort((a, b) => {
45+
const list = [...(this.app.make('app.routes') as RouteDefinition[])].sort((a, b) => {
4646
if (a.path === '/' && b.path !== '/') return -1
4747
if (b.path === '/' && a.path !== '/') return 1
4848
return a.path.localeCompare(b.path)

packages/router/src/Route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class Router implements IRouter {
7171
const fullPath = `${this.groupPrefix}${path}`.replace(/\/+/g, '/')
7272
this.routes.push({ method, path: fullPath, name, handler, signature })
7373
this.h3App[method as 'get'](fullPath, this.resolveHandler(handler, middleware))
74-
this.app.singleton<any>('routes', () => this.routes)
74+
this.app.singleton('app.routes', () => this.routes)
7575
}
7676

7777
/**

0 commit comments

Comments
 (0)