serve-static-bun icon indicating copy to clipboard operation
serve-static-bun copied to clipboard

Remove process.cwd() as root folder

Open lazuee opened this issue 10 months ago • 2 comments

Why there's a need to add process.cwd()? Give us the freedom to use absolute path... https://github.com/jakobbouchard/serve-static-bun/blob/7ed89cd0d142844f73ac158b0fcb351553cc89dc/src/serve-static.ts#L236C1-L236C36

I can't do like this because of that process.cwd() as root prefix..

import path from "path";
import Bao from "baojs";
import serveStatic from "serve-static-bun";

const app = new Bao();
const staticFolder = path.join(import.meta.dir, "..", "/public");
app.get("/gamefiles/*any", serveStatic(staticFolder, { middlewareMode: "bao", stripFromPathname: "/gamefiles" }));

lazuee avatar Mar 29 '24 08:03 lazuee