From bb016c46cdb92b5b6a9df207a9aac72f469173e7 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 20 Jun 2022 12:50:31 +0100 Subject: [PATCH] feat: expose router in NitroApp (#302) --- src/runtime/app.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/app.ts b/src/runtime/app.ts index 3b00423b16..d699ae4341 100644 --- a/src/runtime/app.ts +++ b/src/runtime/app.ts @@ -1,4 +1,4 @@ -import { App as H3App, createApp, createRouter, lazyEventHandler } from 'h3' +import { App as H3App, createApp, createRouter, lazyEventHandler, Router } from 'h3' import { createFetch, Headers } from 'ohmyfetch' import destr from 'destr' import { createRouter as createMatcher } from 'radix3' @@ -13,7 +13,8 @@ import { handlers } from '#internal/nitro/virtual/server-handlers' export interface NitroApp { h3App: H3App - hooks: Hookable, + router: Router + hooks: Hookable localCall: ReturnType localFetch: ReturnType } @@ -65,6 +66,7 @@ function createNitroApp (): NitroApp { const app: NitroApp = { hooks, h3App, + router, localCall, localFetch }