Skip to content

Instantly share code, notes, and snippets.

View WhereJuly's full-sized avatar

WhereJuly WhereJuly

  • Berditshev, Ukraine
View GitHub Profile
@WhereJuly
WhereJuly / example.ts
Last active February 20, 2024 14:39
fastify-http-proxy (fastify/reply-from) replyOptions.onResponse getting the original response body example
'use strict';
import fastify, { FastifyReply, FastifyRequest, RawReplyDefaultExpression, RawServerBase, RequestGenericInterface } from 'fastify';
import proxy from '@fastify/http-proxy';
const server = fastify();
server.register(proxy, {
upstream: 'http://proxied.tld',
prefix: '/proxied',