Esempio n. 1
0
        public override HttpResponse RunEndpoint(HttpRequest req)
        {
            HttpResponse res = new HttpResponse();

            res.body = File.ReadAllBytes(path);
            res.headers["Content-Type"] = MIMEMap.getMIMEType(path.Split(".")[path.Split(".").Length - 1]);

            return(res);
        }
Esempio n. 2
0
 public FileEndpoint(string _path)
 {
     path        = _path;
     contentType = MIMEMap.getMIMEType(_path.Split(".")[_path.Split(".").Length - 1]);
 }
 public CachedFileEndpoint(string _path)
 {
     fileData    = File.ReadAllBytes(_path);
     contentType = MIMEMap.getMIMEType(_path.Split(".")[_path.Split(".").Length - 1]);
 }