Skip to content

Conversation

@ro80t
Copy link

@ro80t ro80t commented Apr 23, 2025

You can use absolute paths on windows, linux, mac, etc. by setting the option absolutePath to true.

I made it because I needed this feature to create a Hono handler in sveltekit's adapter-node.

Example

app.use(serveStatic({
  absolutePath: true,
  root: path.join(import.meta.dirname, './assets')
}));

@ro80t ro80t closed this Apr 23, 2025
@ro80t ro80t reopened this Apr 23, 2025
@ro80t
Copy link
Author

ro80t commented Apr 23, 2025

There was a possibility that the absolutePath option was not applied to the path option, so I temporarily closed the pull request and checked.

We confirmed that it was applied correctly, so we reopened the pull request.

@ro80t
Copy link
Author

ro80t commented May 3, 2025

sorry for reping.
Please review this pull request.

@yusukebe

@ro80t
Copy link
Author

ro80t commented May 27, 2025

Please review when you have time.

@yusukebe

@yusukebe
Copy link
Member

This is not an easy issue. I'll work on it later.

@ro80t
Copy link
Author

ro80t commented Jun 16, 2025

I understood.
Sorry for rushing you.

@yusukebe
Copy link
Member

yusukebe commented Jul 3, 2025

@ROBOTofficial

No problem! I'll work on this issue soon. Thanks!

@yusukebe
Copy link
Member

Hi @ROBOTofficial

Now, the latest version supports an absolute path for the serve-static! So this PR is not needed, but thank you!

@yusukebe yusukebe closed this Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants