serve static at /static

This commit is contained in:
Carl Pearson
2024-09-20 05:22:43 -06:00
parent 1b229f7417
commit df61a06435
3 changed files with 7 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ RUN apt-get update \
COPY --from=0 /usr/local/bin/yt-dlp /usr/local/bin/yt-dlp
COPY --from=0 /src/server /opt/server
ADD templates /opt/templates
ADD static /opt/static
WORKDIR /opt
CMD ["/opt/server"]

View File

@@ -105,9 +105,13 @@ func main() {
e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware)
e.GET("/temp/:token", tempHandler)
staticGroup := e.Group("/data")
dataGroup := e.Group("/data")
dataGroup.Use(authMiddleware)
dataGroup.Static("/", getDataDir())
staticGroup := e.Group("/static")
staticGroup.Use(authMiddleware)
staticGroup.Static("/", getDataDir())
staticGroup.Static("/", "static")
secure := getSecure()

0
static/.gitkeep Normal file
View File