Documentation ¶
Overview ¶
Package route and its subpackages provides most of what you need for http server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Router ¶
Router embeds chi router
func FilesServer ¶
FilesServer gives you a (sub)router that serves only files from a directory (it hides your direcory structure) - accessing a (sub)directory will lead to index.html or StatusNotFound
A full path to served dir is required.
If mounted as a subrouter under certain path XY, specify stripPrefix equal to the mounting path XY.
Here is an example usage:
router := route.New() ... workDir, _ := os.Getwd() dir := filepath.Join(workDir, "relative_path_to_dir") router.Mount("/static", route.FileServer("/static", dir))
Directories ¶
Path | Synopsis |
---|---|
Package ctx contains setters and getters for request context.
|
Package ctx contains setters and getters for request context. |
Package middleware contains middlewares for logging, auth, custom errors and so on.
|
Package middleware contains middlewares for logging, auth, custom errors and so on. |
Click to show internal directories.
Click to hide internal directories.