fix: don't fallthrough static files in dev (#2156)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { PageProps } from "$fresh/server.ts";
|
||||
|
||||
export default function App({ Component }: PageProps) {
|
||||
return (
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>My Fresh app</title>
|
||||
<link rel="stylesheet" href="/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<Component />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function Page() {
|
||||
return <h1>test</h1>;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { basename, dirname, extname, fromFileUrl } from "../../deps.ts";
|
||||
|
||||
const __dirname = dirname(fromFileUrl(import.meta.url));
|
||||
|
||||
const links: string[] = [];
|
||||
for (const file of Deno.readDirSync(__dirname)) {
|
||||
if (file.name.startsWith("index")) continue;
|
||||
const name = basename(file.name, extname(file.name));
|
||||
links.push(name);
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Tests</h1>
|
||||
<ul>
|
||||
{links.sort().map((link) => {
|
||||
return (
|
||||
<li key={link}>
|
||||
<a href={`/${link}`}>{link}</a>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user