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); }
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]); }