Skip to content

Commit 6bdc359

Browse files
committed
sync9
1 parent 50a8e2e commit 6bdc359

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

http/new/redirect.deno.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Engine from "../../engine/library.d.ts";
2+
import lsSetup from "../../console.ts";
3+
4+
let _del:()=>void;
5+
let td=new TextDecoder;
6+
let te=new TextEncoder;
7+
const [_logfile,logsole]=lsSetup();
8+
9+
export default async function main(socket: Engine.HttpSocket|Engine.PseudoHttpSocket, url: URL, get: string, opt:Record<string,any>|void){
10+
const nu=`https://www.cppdev.dev/${socket.client?.path||""}`;
11+
logsole.log("redirect.deno.ts redirect to new domain")
12+
socket.setHeader("Location",nu);
13+
socket.status=301;
14+
socket.close(`<a href="${nu}">main site</a><script>location="${nu}"</script>`);
15+
}
16+
17+
export async function init(socket: Engine.HttpSocket|Engine.PseudoHttpSocket, url: URL, get: string, opt:Record<string,any>|void, dele: ()=> void, past: any|void, imports:Record<string,any>){
18+
_del=dele;
19+
main(socket,url,get,opt);
20+
}
21+
22+
export const state:{active:boolean}={
23+
active:false,
24+
};

last-pid.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5808
1+
4492

0 commit comments

Comments
 (0)