Closed dbrain closed 12 years ago
This is done, as middleware.
// Capture requests for /mountpoint/static and look for files in CWD/public
server.Use(soggy.NewStaticServerMiddleware("/static"))
// Change default static path
server.Config.SetStaticPath("notPublic")
If file is not found or a directory it will continue to the next middleware (hitting 404 handlers or your own route starting with /static).
As somebody from the past, I'd like to be able to serve static files to a user without writing my own io code, probably from a set directory, with some funkiness around what headers are sent back so the files can be cached.