Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for multiple static directories with failover #205

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

support for multiple static directories with failover #205

wants to merge 3 commits into from

Conversation

Maldris
Copy link

@Maldris Maldris commented Aug 9, 2016

existing static directories string is now tokenized and caches in a slice and serving static files iterates over this slice to find the directory.
If it is unable to find the file if fails over the the default static directories rather than failing outright (old behavior).
This is useful when trying to serve vendor files from a package manager (i.e. npm) as I didnt wish to move my static files into "node_modules"

Scott Owens added 2 commits August 9, 2016 12:16
…und.

added support for multiple custom defined static directories,
  both in the existing string format (so as not to be breaking to existing uses)
  and through a new string array that caches the list
@Maldris
Copy link
Author

Maldris commented Aug 9, 2016

realised I forgot to push the fixed version, pardon me. Ill correct that

@Maldris
Copy link
Author

Maldris commented Aug 9, 2016

forgot to call gofmt, apologies, it appears to be a forgetful day today.

@hoisie
Copy link
Owner

hoisie commented Aug 9, 2016

Out of curiosity, could you achieve the same thing using symbolic links in the filesystem?

@Maldris
Copy link
Author

Maldris commented Aug 9, 2016

most likely, yes.
But this project is annoying and one of the bosses insists on running one of the servers on windows, and that's just not worth the effort, this change was faster and easier for us to maintain than screwing around with the file directory structure in windows, far to easy to screw up and cause larger problems.
If you'd rather not merge these changes that's file, Ill keep the fork around in the event its useful to someone.

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.

None yet

2 participants