make StaticFileEndpoint just a function