feat(server): remove rice in the server #117
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey,
this is an attempt at removing dependency on rice, as it's not supported for quite some time now and to use the go embed directive instead.
If anyone wants to test, I'll be happy to get feedbacks and fix things if they're broken.
So far, I've built the server directly with
go build -o server .in the server directory, using the Makefile, and with the Dockerfile (using themake dockertarget).I simply tried to upload a file (both through the web interface and the cli) and download it and it seems to work, but I'd like more testing if possible.
Regarding the assets/templates stuff, I have a webpage displayed once I run the server, so the embedding seems to work ok. I had to move the assets and templates directories under server/utils so that embed can use them (it's not possible to use upper directories from what I've understood so far).
I've changed the default port for the server when there is no configuration file as it makes it much easier to have the same port if it is being run in a container.