Contains the Concourse pipeline definition for building a line-server container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
420 B

  1. package main
  2. import (
  3. "net/http"
  4. "os"
  5. "path"
  6. "github.com/zenazn/goji/web"
  7. )
  8. func fileServeHandler(c web.C, w http.ResponseWriter, r *http.Request) {
  9. fileName := c.URLParams["name"]
  10. filePath := path.Join(Config.filesDir, fileName)
  11. _, err := os.Stat(filePath)
  12. if os.IsNotExist(err) {
  13. http.Error(w, http.StatusText(404), 404)
  14. return
  15. }
  16. // plug file expiry checking here
  17. http.ServeFile(w, r, filePath)
  18. }