mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-10 00:13:54 +05:00
feat/api-prox: add GET proxy
This commit is contained in:
parent
1a439f0a77
commit
32e830cae1
3 changed files with 49 additions and 8 deletions
|
@ -4,16 +4,16 @@ export const RouteLogger = (message: string) => {
|
|||
const method = args[1];
|
||||
const url = new URL("http://example.com" + args[2]);
|
||||
if (url.searchParams.get("token")) {
|
||||
url.searchParams.set("token", "*********");
|
||||
url.searchParams.set("token", "***");
|
||||
}
|
||||
|
||||
if (direction == "<--") {
|
||||
console.log(`REQ | ${method} ${url.pathname}${url.search}`);
|
||||
console.log(`--> REQ | ${method} ${url.pathname}${url.search}`);
|
||||
} else {
|
||||
const status = args[3];
|
||||
const time = args[4];
|
||||
console.log(
|
||||
`RES | ${method} ${url.pathname}${url.search} ${status} ${time}`
|
||||
`<-- RES | ${method} ${url.pathname}${url.search} ${status} ${time}`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue