add router
This commit is contained in:
@@ -8,7 +8,6 @@ import { useConfig } from '@abearxiong/use-config';
|
||||
import { redis } from './redis/redis.ts';
|
||||
import { getContentType } from './get-content-type.ts';
|
||||
import { sleep } from '@/utils/sleep.ts';
|
||||
import { handleProxyRequest } from './proxy.ts';
|
||||
const { api, domain, allowedOrigins } = useConfig<{
|
||||
api: {
|
||||
host: string;
|
||||
@@ -71,10 +70,7 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
|
||||
res.end('not catch api');
|
||||
return;
|
||||
}
|
||||
if (req.url.startsWith('/test')) {
|
||||
handleProxyRequest(req, res);
|
||||
return;
|
||||
}
|
||||
|
||||
const dns = getDNS(req);
|
||||
// 配置可以跨域
|
||||
// 配置可以访问的域名 localhost, xiongxiao.me
|
||||
|
||||
Reference in New Issue
Block a user