svenstaro / miniserve

🌟 For when you really just want to serve some files over HTTP right now!
MIT License
5.94k stars 289 forks source link

Add custom route/redirection #754

Open Dialga opened 2 years ago

Dialga commented 2 years ago

Feature request: Add the ability to serve a file/folder under a custom path, the use case I envision is for shorten urls for files under a long path. Something like this:

miniserve . linux=pacman/pkg/linux-5.16.12.x86_64.pkg.tar.zst # or
miniserve . --path linux=pacman/pkg/linux-5.16.12.x86_64.pkg.tar.zst # or
miniserve . --route linux=pacman/pkg/linux-5.16.12.x86_64.pkg.tar.zst  # or
miniserve . --redirect linux=pacman/pkg/linux-5.16.12.x86_64.pkg.tar.zst 
svenstaro commented 2 years ago

I think this sounds like a cool feature. I like the last option best as it's the most clearly named one. Do you want to take a stab at it?

Dialga commented 2 years ago

Hi, I am just an avid user, thanks.

stappersg commented 1 year ago

While going through the open issues, I came along a sym link issue.

Idea: Use symbolic links to shorten URLs.