File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @blitzjs/next " : patch
3
+ " blitz " : patch
4
+ ---
5
+
6
+ feat: export ` BlitzServerMiddleware ` from blitz-next with stronger types
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
22
22
RouteUrlObject ,
23
23
startWatcher ,
24
24
stopWatcher ,
25
+ RequestMiddleware ,
25
26
} from "blitz"
26
27
import {
27
28
getInfiniteQueryKey ,
@@ -347,3 +348,15 @@ declare module "blitz" {
347
348
prefetchInfiniteQuery : PrefetchQueryFn
348
349
}
349
350
}
351
+
352
+ export const BlitzServerMiddleware = <
353
+ TMiddleware extends RequestMiddleware < NextApiRequest , BlitzNextApiResponse > = RequestMiddleware <
354
+ NextApiRequest ,
355
+ BlitzNextApiResponse
356
+ > ,
357
+ > (
358
+ middleware : TMiddleware ,
359
+ ) : BlitzServerPlugin < { } > => ( {
360
+ requestMiddlewares : [ middleware ] ,
361
+ exports : ( ) => ( { } ) ,
362
+ } )
You can’t perform that action at this time.
0 commit comments