Serve templates and static files from designated directories
This commit is contained in:
parent
b98ec87d8d
commit
64d40bd108
@ -102,8 +102,11 @@ var startCmd = &cobra.Command{
|
|||||||
BaseContext: func(_ net.Listener) context.Context { return ctx }, // Pass base context to all requests
|
BaseContext: func(_ net.Listener) context.Context { return ctx }, // Pass base context to all requests
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serve the components directory
|
// Serve the templates and static files
|
||||||
httpRequestRouter.Handle("/", http.FileServer(http.Dir("./components")))
|
// Serve templates from the "templates" directory
|
||||||
|
httpRequestRouter.Handle("/", http.FileServer(http.Dir("./templates")))
|
||||||
|
// Serve static files from the "static" directory
|
||||||
|
httpRequestRouter.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static"))))
|
||||||
|
|
||||||
// Log server startup with structured logging
|
// Log server startup with structured logging
|
||||||
logger.Info("starting server",
|
logger.Info("starting server",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user