Skip to content

Conversation

zekroTJA
Copy link

@zekroTJA zekroTJA commented May 8, 2022

This pull request adds the option FS to the ServerOptions of the file server middleware which allows passing an fs.FS as content root.

For example, this makes it possible to use static web files directly compiled into the binary using embed.FS.

When the FS field is specified, this overrides the set RootPath. Otherwise, when FS is not specified, the given (or default) RootPath is used via os.DirFS.

Additionally, I've added a .gitattribute which specifies the contents of file/testdata to be cloned with LF end of lines. Otherwise, all unit tests fail when cloned on a Windows system because files are converted to CLRF.

zekroTJA added 2 commits May 8, 2022 11:03
Add .gitattributes where EOL is set to LF for testdata in file package so that tests would not fail on Windows systems.
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.

1 participant