use built-in URL api for resolving static folder
This commit is contained in:
parent
10c2540cff
commit
c4a2bfd20a
1 changed files with 1 additions and 2 deletions
|
|
@ -1,12 +1,11 @@
|
||||||
import createServer from "@tomphttp/bare-server-node";
|
import createServer from "@tomphttp/bare-server-node";
|
||||||
import { fileURLToPath } from "url";
|
import { fileURLToPath } from "url";
|
||||||
import { dirname, join } from "path";
|
|
||||||
import http from "http";
|
import http from "http";
|
||||||
import serveStatic from "serve-static";
|
import serveStatic from "serve-static";
|
||||||
|
|
||||||
const bare = createServer("/bare/");
|
const bare = createServer("/bare/");
|
||||||
const serve = serveStatic(
|
const serve = serveStatic(
|
||||||
join(dirname(fileURLToPath(import.meta.url)), "static/"),
|
fileURLToPath(new URL("../static/", import.meta.url)),
|
||||||
{ fallthrough: false }
|
{ fallthrough: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue