Add ability to do debug logging with REQ_DEBUG=true
This commit is contained in:
parent
ad0ae4aaae
commit
5faca36cb4
|
@ -6,7 +6,7 @@ export default defineNitroConfig({
|
|||
noPublicDir: true,
|
||||
srcDir: "./src",
|
||||
runtimeConfig: {
|
||||
version: pkg.version,
|
||||
version: pkg.version
|
||||
},
|
||||
alias: {
|
||||
"@": join(__dirname, "src")
|
||||
|
|
|
@ -69,7 +69,15 @@ export async function specificProxyRequest(
|
|||
opts.fetchOptions?.headers,
|
||||
opts.headers,
|
||||
);
|
||||
(fetchHeaders.forEach as any)(console.log);
|
||||
const headerObj = Object.fromEntries([...(fetchHeaders.entries as any)()]);
|
||||
if (process.env.REQ_DEBUG === 'true') {
|
||||
console.log({
|
||||
type: 'request',
|
||||
method,
|
||||
url: target,
|
||||
headers: headerObj,
|
||||
});
|
||||
}
|
||||
|
||||
return sendProxy(event, target, {
|
||||
...opts,
|
||||
|
|
Loading…
Reference in New Issue