Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
plusminushalf committed Nov 22, 2024
1 parent ef0d84c commit 34c0056
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/pages/infra/platform/security/protect-api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fastify.addHook('preHandler', async (request, reply) => {
// Setup proxy to Pimlico API
fastify.register(proxy, {
upstream: `https://api.pimlico.io/v2/137/rpc?apikey=${PIMLICO_API_KEY}`,
prefix: '/api/proxy', // Optional: prefix all routes with /api/proxy
prefix: '/api/proxy',
rewriteRequestHeaders: (req, headers) => ({
...headers,
})
Expand Down Expand Up @@ -92,10 +92,10 @@ app.use('/api/proxy', createProxyMiddleware({
target: targetUrl,
changeOrigin: true,
pathRewrite: {
'^/proxy': '', // Remove '/proxy' from the path
'^/api/proxy': '', // Remove '/proxy' from the path
},
onProxyReq: (proxyReq, req) => {
// Ensure JSON content type if necessary
// Ensure JSON content type
proxyReq.setHeader('Content-Type', 'application/json');
},
}));
Expand Down

0 comments on commit 34c0056

Please sign in to comment.