ImLunaHey / serve-static-bun

Serve static files using Bun.serve or Bao.js
https://npm.im/serve-static-bun
MIT License
23 stars 1 forks source link

Remove process.cwd() as root folder #8

Open lazuee opened 3 months ago

lazuee commented 3 months ago

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 commented 3 months ago

Merge this pull request #9 to be able to use absolute path

jakobbouchard commented 4 weeks ago

Hello! :wave: I no longer work in web development, and do not have a lot of free time or interest in maintaining this package anymore. I am closing all issues and PR for it and will archive the repository, but if anybody is interested in maintaining it, I am willing to transfer the repository and NPM package. I'm sorry that I didn't have time to review your PR.