Skip to content

Commit

Permalink
do not serve static assets under /static from / anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Jul 16, 2024
1 parent d642f3d commit 6bf2585
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/primate/src/hooks/handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@ export default app => {
const handle = async request => {
const { pathname } = request.url;
if (pathname.startsWith(root)) {
const debased = pathname.replace(root, _ => "");
// try static first
const asset = client.join(location.static, debased);
if (await asset.isFile) {
return as_asset(asset);
}
const path = client.join(debased);
const path = client.join(pathname.replace(root, _ => ""));
if (await path.isFile) {
return as_asset(path);
}
Expand Down

0 comments on commit 6bf2585

Please sign in to comment.