Skip to content

Commit

Permalink
fixing paths on static server
Browse files Browse the repository at this point in the history
  • Loading branch information
mimiMonads committed Feb 11, 2023
1 parent 4c9478f commit 4af98a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion optimizer/staticFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default (o?: funRouterOptions) =>
: "extra" in f
? mime.concat(f.extra)
: mime,
)(p)(f.name),
)(p)(f.name)(f.path),
),
),
))(
Expand Down
5 changes: 3 additions & 2 deletions optimizer/staticPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { RouteTypes } from "../types.ts";
export default (mine: [string, string][]) =>
(arr: string[]) =>
(name: string) =>
(path: string) =>
arr.map(
(x) =>
(
Expand All @@ -12,7 +13,7 @@ export default (mine: [string, string][]) =>
el
? [
"GET",
name + x.slice(1),
name + x.slice(path.length),
(new Function(
`return async _=> new Response( await Deno.readTextFile("${x}"),
{headers: {'Content-Type': '${el[1]}'}}
Expand All @@ -22,7 +23,7 @@ export default (mine: [string, string][]) =>
]
: [
"GET",
name + x.slice(1),
name + x.slice(path.length),
(new Function(
`return async _=> new Response(await Deno.readTextFile("${x}"))`,
))(),
Expand Down

0 comments on commit 4af98a5

Please sign in to comment.