File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 1
1
/// <reference types="node" />
2
2
3
- import {
4
- FastifyPlugin ,
5
- preHandlerHookHandler
6
- } from "fastify" ;
3
+ import { FastifyPlugin , preHandlerHookHandler } from "fastify" ;
7
4
8
5
import {
9
- FastifyReplyFromOptions
10
- } from "fastify-reply-from"
6
+ FastifyReplyFromOptions ,
7
+ FastifyReplyFromHooks ,
8
+ } from "fastify-reply-from" ;
11
9
12
- import {
13
- ClientOptions ,
14
- ServerOptions
15
- } from "ws"
10
+ import { ClientOptions , ServerOptions } from "ws" ;
16
11
17
12
export interface FastifyHttpProxyOptions extends FastifyReplyFromOptions {
18
13
upstream : string ;
@@ -22,10 +17,10 @@ export interface FastifyHttpProxyOptions extends FastifyReplyFromOptions {
22
17
preHandler ?: preHandlerHookHandler ;
23
18
beforeHandler ?: preHandlerHookHandler ;
24
19
config ?: Object ;
25
- replyOptions ?: Object ;
26
- websocket ?: boolean
27
- wsClientOptions ?: ClientOptions
28
- wsServerOptions ?: ServerOptions
20
+ replyOptions ?: FastifyReplyFromHooks ;
21
+ websocket ?: boolean ;
22
+ wsClientOptions ?: ClientOptions ;
23
+ wsServerOptions ?: ServerOptions ;
29
24
}
30
25
31
26
declare const fastifyHttpProxy : FastifyPlugin < FastifyHttpProxyOptions > ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ app.register(fastifyHttpProxy, {
14
14
rewritePrefix : "/u" ,
15
15
http2 : false ,
16
16
config : { key : 1 } ,
17
- replyOptions : { opt : "a " } ,
17
+ replyOptions : { contentType : "application/json " } ,
18
18
preHandler : ( request , reply ) => {
19
19
expectType < RawRequestDefaultExpression > ( request . raw ) ;
20
20
expectType < RawReplyDefaultExpression > ( reply . raw ) ;
You can’t perform that action at this time.
0 commit comments