-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathserver.ts
More file actions
35 lines (34 loc) · 816 Bytes
/
server.ts
File metadata and controls
35 lines (34 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import presetUno from "@unocss/preset-uno";
import { serve } from "aleph/react-server";
import MDXLoader from "aleph/react/mdx-loader";
import routes from "./routes/_export.ts";
import remarkFrontmatter from "remark-frontmatter";
import rehypeHighlight from "rehype-highlight";
serve({
router: {
glob: "./routes/**/*.{ts,tsx,mdx,md}",
routes,
},
unocss: {
presets: [presetUno()],
},
loaders: [
new MDXLoader({
remarkPlugins: [remarkFrontmatter],
rehypePlugins: [rehypeHighlight],
}),
],
middlewares: [
{
name: "proxy-init-script",
fetch(req: Request) {
if (req.url.endsWith("/init.ts")) {
return fetch(
"https://deno.land/x/aleph" + (new URL(req.url)).pathname,
);
}
},
},
],
ssr: true,
});