Skip to content

Commit bd63417

Browse files
committed
Update index.ts
1 parent 418b611 commit bd63417

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

src/server/index.ts

+6-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
import { route, type Route } from "@std/http/unstable-route";
2-
import { STATUS_CODE } from "@std/http";
32
import pageHandler from './request_handler/page_handler.ts';
43

54
const rootDirectory = './dist/';
65
const appDirectory = `${rootDirectory}/app/`;
76

87
const routes: Route[] = [
9-
{
10-
pattern: new URLPattern({ pathname: '/' }),
11-
handler: (request) => {
12-
return Response.redirect(
13-
request.url + 'home',
14-
STATUS_CODE.MovedPermanently
15-
)
16-
}
17-
},
188
{
199
pattern: new URLPattern({ pathname: "/-/:staticAsset*" }),
2010
handler: (request, _info, parameters) => pageHandler(
@@ -36,15 +26,12 @@ const routes: Route[] = [
3626
);
3727
}
3828
},
39-
// {
40-
// pattern: new URLPattern({ pathname: '/:path([^\.]+$)' }),
41-
// handler: (request, _info, parameters) => {
42-
// const {path} = parameters?.pathname.groups ?? {};
43-
// console.log('page', path)
44-
// return pageHandler(request, appDirectory, '')
45-
// }
46-
// },
47-
29+
{
30+
pattern: new URLPattern({ pathname: '/:path(.*)' }),
31+
handler: (request) => {
32+
return pageHandler(request, appDirectory, '')
33+
}
34+
}
4835
];
4936

5037
Deno.serve(

0 commit comments

Comments
 (0)