serve static at /static
This commit is contained in:
@@ -22,6 +22,7 @@ RUN apt-get update \
|
|||||||
COPY --from=0 /usr/local/bin/yt-dlp /usr/local/bin/yt-dlp
|
COPY --from=0 /usr/local/bin/yt-dlp /usr/local/bin/yt-dlp
|
||||||
COPY --from=0 /src/server /opt/server
|
COPY --from=0 /src/server /opt/server
|
||||||
ADD templates /opt/templates
|
ADD templates /opt/templates
|
||||||
|
ADD static /opt/static
|
||||||
|
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
CMD ["/opt/server"]
|
CMD ["/opt/server"]
|
||||||
|
8
main.go
8
main.go
@@ -105,9 +105,13 @@ func main() {
|
|||||||
e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware)
|
e.POST("/video/:id/delete", videoDeleteHandler, authMiddleware)
|
||||||
e.GET("/temp/:token", tempHandler)
|
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.Use(authMiddleware)
|
||||||
staticGroup.Static("/", getDataDir())
|
staticGroup.Static("/", "static")
|
||||||
|
|
||||||
secure := getSecure()
|
secure := getSecure()
|
||||||
|
|
||||||
|
0
static/.gitkeep
Normal file
0
static/.gitkeep
Normal file
Reference in New Issue
Block a user