Templates: fix the content type of templates

Templating is weird af in Rocket. Look into 3a541ae for more.
The content-type of the rendering is determined by the extension of the
template name.

But renaming these templates would break building the project for
development because it finds a phony template there. So the trick is to
default the `template_dir` to `args.upload` because it should never
interfere and will be always present.
This also fixes the hax in Dockerfile by making it the default.

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2022-01-19 13:37:07 +05:30
parent a11321c251
commit edc247b558
8 changed files with 13 additions and 15 deletions

View File

@@ -25,8 +25,6 @@ FROM scratch as runner
COPY --from=builder /usr/local/cargo/bin/bin .
ENV BIN_ADDRESS=0.0.0.0
# Some hax required since we are running on scratch
ENV BIN_TEMPLATE_DIR=upload
EXPOSE 6162
CMD ["./bin"]