Пример #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);
        }
Пример #2
0
 public FileEndpoint(string _path)
 {
     path        = _path;
     contentType = MIMEMap.getMIMEType(_path.Split(".")[_path.Split(".").Length - 1]);
 }
Пример #3
0
 public CachedFileEndpoint(string _path)
 {
     fileData    = File.ReadAllBytes(_path);
     contentType = MIMEMap.getMIMEType(_path.Split(".")[_path.Split(".").Length - 1]);
 }