Closed d3roch4 closed 6 years ago
Hey @d3roch4, the raw content of the file is the body of the request, and then you need to set the "Content-Type" header of the response to match the type of content you are serving.
tank you! its work
2016-05-17 8:30 GMT-03:00 Ashley Jeffs notifications@github.com:
Hey @d3roch4 https://github.com/d3roch4, the raw content of the file is the body of the request, and then you need to set the "Content-Type" header of the response to match the type of content you are serving.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/datasift/served/issues/15#issuecomment-219691359
[code]
// Static File Handler
mux.handle("/files/{file}")
.get([](served::response & res, const served::request & req) {
string fileName = "/var/www/" + req.params["file"];
ifstream inFile(fileName);
if(!inFile.is_open()){
res.set_status(404);
res << "File: " << fileName << " not found";
return;
}
stringstream stream;
stream << inFile.rdbuf();
res.set_body(stream.str());
res.set_header("Content-Type",get_mime(fileName));
});
using namespace std;
map<string,string> mimes;
string get_mime(string filename){
auto idx = filename.rfind('.');
if(idx != string::npos)
{
string extension = filename.substr(idx+1);
string* mime = &mimes[extension];
auto it = mimes.find(extension);
if(it!= mimes.end()){
return it->second;
}
}
return string("application/octet-stream");
}
void init_mimes(){
mimes["323"] = "text/h323"; mimes["3g2"] = "video/3gpp2"; mimes["3gp"] = "video/3gpp"; mimes["3gp2"] = "video/3gpp2"; mimes["3gpp"] = "video/3gpp"; mimes["7z"] = "application/x-7z-compressed"; mimes["aa"] = "audio/audible"; mimes["AAC"] = "audio/aac"; mimes["aaf"] = "application/octet-stream"; mimes["aax"] = "audio/vnd.audible.aax"; mimes["ac3"] = "audio/ac3"; mimes["aca"] = "application/octet-stream"; mimes["accda"] = "application/msaccess.addin"; mimes["accdb"] = "application/msaccess"; mimes["accdc"] = "application/msaccess.cab"; mimes["accde"] = "application/msaccess"; mimes["accdr"] = "application/msaccess.runtime"; mimes["accdt"] = "application/msaccess"; mimes["accdw"] = "application/msaccess.webapplication"; mimes["accft"] = "application/msaccess.ftemplate"; mimes["acx"] = "application/internet-property-stream"; mimes["AddIn"] = "text/xml"; mimes["ade"] = "application/msaccess"; mimes["adobebridge"] = "application/x-bridge-url"; mimes["adp"] = "application/msaccess"; mimes["ADT"] = "audio/vnd.dlna.adts"; mimes["ADTS"] = "audio/aac"; mimes["afm"] = "application/octet-stream"; mimes["ai"] = "application/postscript"; mimes["aif"] = "audio/x-aiff"; mimes["aifc"] = "audio/aiff"; mimes["aiff"] = "audio/aiff"; mimes["air"] = "application/vnd.adobe.air-application-installer-package+zip"; mimes["amc"] = "application/x-mpeg"; mimes["application"] = "application/x-ms-application"; mimes["art"] = "image/x-jg"; mimes["asa"] = "application/xml"; mimes["asax"] = "application/xml"; mimes["ascx"] = "application/xml"; mimes["asd"] = "application/octet-stream"; mimes["asf"] = "video/x-ms-asf"; mimes["ashx"] = "application/xml"; mimes["asi"] = "application/octet-stream"; mimes["asm"] = "text/plain"; mimes["asmx"] = "application/xml"; mimes["aspx"] = "application/xml"; mimes["asr"] = "video/x-ms-asf"; mimes["asx"] = "video/x-ms-asf"; mimes["atom"] = "application/atom+xml"; mimes["au"] = "audio/basic"; mimes["avi"] = "video/x-msvideo"; mimes["axs"] = "application/olescript"; mimes["bas"] = "text/plain"; mimes["bcpio"] = "application/x-bcpio"; mimes["bin"] = "application/octet-stream"; mimes["bmp"] = "image/bmp"; mimes["svg"] = "image/svg+xml"; mimes["c"] = "text/plain"; mimes["cab"] = "application/octet-stream"; mimes["caf"] = "audio/x-caf"; mimes["calx"] = "application/vnd.ms-office.calx"; mimes["cat"] = "application/vnd.ms-pki.seccat"; mimes["cc"] = "text/plain"; mimes["cd"] = "text/plain"; mimes["cdda"] = "audio/aiff"; mimes["cdf"] = "application/x-cdf"; mimes["cer"] = "application/x-x509-ca-cert"; mimes["chm"] = "application/octet-stream"; mimes["class"] = "application/x-java-applet"; mimes["clp"] = "application/x-msclip"; mimes["cmx"] = "image/x-cmx"; mimes["cnf"] = "text/plain"; mimes["cod"] = "image/cis-cod"; mimes["config"] = "application/xml"; mimes["contact"] = "text/x-ms-contact"; mimes["coverage"] = "application/xml"; mimes["cpio"] = "application/x-cpio"; mimes["cpp"] = "text/plain"; mimes["crd"] = "application/x-mscardfile"; mimes["crl"] = "application/pkix-crl"; mimes["crt"] = "application/x-x509-ca-cert"; mimes["cs"] = "text/plain"; mimes["csdproj"] = "text/plain"; mimes["csh"] = "application/x-csh"; mimes["csproj"] = "text/plain"; mimes["css"] = "text/css"; mimes["csv"] = "text/csv"; mimes["cur"] = "application/octet-stream"; mimes["cxx"] = "text/plain"; mimes["dat"] = "application/octet-stream"; mimes["datasource"] = "application/xml"; mimes["dbproj"] = "text/plain"; mimes["dcr"] = "application/x-director"; mimes["def"] = "text/plain"; mimes["deploy"] = "application/octet-stream"; mimes["der"] = "application/x-x509-ca-cert"; mimes["dgml"] = "application/xml"; mimes["dib"] = "image/bmp"; mimes["dif"] = "video/x-dv"; mimes["dir"] = "application/x-director"; mimes["disco"] = "text/xml"; mimes["dll"] = "application/x-msdownload"; mimes["dll.config"] = "text/xml"; mimes["dlm"] = "text/dlm"; mimes["doc"] = "application/msword"; mimes["docm"] = "application/vnd.ms-word.document.macroEnabled.12"; mimes["docx"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; mimes["dot"] = "application/msword"; mimes["dotm"] = "application/vnd.ms-word.template.macroEnabled.12"; mimes["dotx"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.template"; mimes["dsp"] = "application/octet-stream"; mimes["dsw"] = "text/plain"; mimes["dtd"] = "text/xml"; mimes["dtsConfig"] = "text/xml"; mimes["dv"] = "video/x-dv"; mimes["dvi"] = "application/x-dvi"; mimes["dwf"] = "drawing/x-dwf"; mimes["dwp"] = "application/octet-stream"; mimes["dxr"] = "application/x-director"; mimes["eml"] = "message/rfc822"; mimes["emz"] = "application/octet-stream"; mimes["eot"] = "application/octet-stream"; mimes["eps"] = "application/postscript"; mimes["etl"] = "application/etl"; mimes["etx"] = "text/x-setext"; mimes["evy"] = "application/envoy"; mimes["exe"] = "application/octet-stream"; mimes["exe.config"] = "text/xml"; mimes["fdf"] = "application/vnd.fdf"; mimes["fif"] = "application/fractals"; mimes["filters"] = "Application/xml"; mimes["fla"] = "application/octet-stream"; mimes["flr"] = "x-world/x-vrml"; mimes["flv"] = "video/x-flv"; mimes["fsscript"] = "application/fsharp-script"; mimes["fsx"] = "application/fsharp-script"; mimes["generictest"] = "application/xml"; mimes["gif"] = "image/gif"; mimes["group"] = "text/x-ms-group"; mimes["gsm"] = "audio/x-gsm"; mimes["gtar"] = "application/x-gtar"; mimes["gz"] = "application/x-gzip"; mimes["h"] = "text/plain"; mimes["hdf"] = "application/x-hdf"; mimes["hdml"] = "text/x-hdml"; mimes["hhc"] = "application/x-oleobject"; mimes["hhk"] = "application/octet-stream"; mimes["hhp"] = "application/octet-stream"; mimes["hlp"] = "application/winhlp"; mimes["hpp"] = "text/plain"; mimes["hqx"] = "application/mac-binhex40"; mimes["hta"] = "application/hta"; mimes["htc"] = "text/x-component"; mimes["htm"] = "text/html"; mimes["html"] = "text/html"; mimes["htt"] = "text/webviewhtml"; mimes["hxa"] = "application/xml"; mimes["hxc"] = "application/xml"; mimes["hxd"] = "application/octet-stream"; mimes["hxe"] = "application/xml"; mimes["hxf"] = "application/xml"; mimes["hxh"] = "application/octet-stream"; mimes["hxi"] = "application/octet-stream"; mimes["hxk"] = "application/xml"; mimes["hxq"] = "application/octet-stream"; mimes["hxr"] = "application/octet-stream"; mimes["hxs"] = "application/octet-stream"; mimes["hxt"] = "text/html"; mimes["hxv"] = "application/xml"; mimes["hxw"] = "application/octet-stream"; mimes["hxx"] = "text/plain"; mimes["i"] = "text/plain"; mimes["ico"] = "image/x-icon"; mimes["ics"] = "application/octet-stream"; mimes["idl"] = "text/plain"; mimes["ief"] = "image/ief"; mimes["iii"] = "application/x-iphone"; mimes["inc"] = "text/plain"; mimes["inf"] = "application/octet-stream"; mimes["inl"] = "text/plain"; mimes["ins"] = "application/x-internet-signup"; mimes["ipa"] = "application/x-itunes-ipa"; mimes["ipg"] = "application/x-itunes-ipg"; mimes["ipproj"] = "text/plain"; mimes["ipsw"] = "application/x-itunes-ipsw"; mimes["iqy"] = "text/x-ms-iqy"; mimes["isp"] = "application/x-internet-signup"; mimes["ite"] = "application/x-itunes-ite"; mimes["itlp"] = "application/x-itunes-itlp"; mimes["itms"] = "application/x-itunes-itms"; mimes["itpc"] = "application/x-itunes-itpc"; mimes["IVF"] = "video/x-ivf"; mimes["jar"] = "application/java-archive"; mimes["java"] = "application/octet-stream"; mimes["jck"] = "application/liquidmotion"; mimes["jcz"] = "application/liquidmotion"; mimes["jfif"] = "image/pjpeg"; mimes["jnlp"] = "application/x-java-jnlp-file"; mimes["jpb"] = "application/octet-stream"; mimes["jpe"] = "image/jpeg"; mimes["jpeg"] = "image/jpeg"; mimes["jpg"] = "image/jpeg"; mimes["js"] = "application/x-javascript"; mimes["json"] = "application/json"; mimes["jsx"] = "text/jscript"; mimes["jsxbin"] = "text/plain"; mimes["latex"] = "application/x-latex"; mimes["library-ms"] = "application/windows-library+xml"; mimes["lit"] = "application/x-ms-reader"; mimes["loadtest"] = "application/xml"; mimes["lpk"] = "application/octet-stream"; mimes["lsf"] = "video/x-la-asf"; mimes["lst"] = "text/plain"; mimes["lsx"] = "video/x-la-asf"; mimes["lzh"] = "application/octet-stream"; mimes["m13"] = "application/x-msmediaview"; mimes["m14"] = "application/x-msmediaview"; mimes["m1v"] = "video/mpeg"; mimes["m2t"] = "video/vnd.dlna.mpeg-tts"; mimes["m2ts"] = "video/vnd.dlna.mpeg-tts"; mimes["m2v"] = "video/mpeg"; mimes["m3u"] = "audio/x-mpegurl"; mimes["m3u8"] = "audio/x-mpegurl"; mimes["m4a"] = "audio/m4a"; mimes["m4b"] = "audio/m4b"; mimes["m4p"] = "audio/m4p"; mimes["m4r"] = "audio/x-m4r"; mimes["m4v"] = "video/x-m4v"; mimes["mac"] = "image/x-macpaint"; mimes["mak"] = "text/plain"; mimes["man"] = "application/x-troff-man"; mimes["manifest"] = "application/x-ms-manifest"; mimes["map"] = "text/plain"; mimes["master"] = "application/xml"; mimes["mda"] = "application/msaccess"; mimes["mdb"] = "application/x-msaccess"; mimes["mde"] = "application/msaccess"; mimes["mdp"] = "application/octet-stream"; mimes["me"] = "application/x-troff-me"; mimes["mfp"] = "application/x-shockwave-flash"; mimes["mht"] = "message/rfc822"; mimes["mhtml"] = "message/rfc822"; mimes["mid"] = "audio/mid"; mimes["midi"] = "audio/mid"; mimes["mix"] = "application/octet-stream"; mimes["mk"] = "text/plain"; mimes["mmf"] = "application/x-smaf"; mimes["mno"] = "text/xml"; mimes["mny"] = "application/x-msmoney"; mimes["mod"] = "video/mpeg"; mimes["mov"] = "video/quicktime"; mimes["movie"] = "video/x-sgi-movie"; mimes["mp2"] = "video/mpeg"; mimes["mp2v"] = "video/mpeg"; mimes["mp3"] = "audio/mpeg"; mimes["mp4"] = "video/mp4"; mimes["mp4v"] = "video/mp4"; mimes["mpa"] = "video/mpeg"; mimes["mpe"] = "video/mpeg"; mimes["mpeg"] = "video/mpeg"; mimes["mpf"] = "application/vnd.ms-mediapackage"; mimes["mpg"] = "video/mpeg"; mimes["mpp"] = "application/vnd.ms-project"; mimes["mpv2"] = "video/mpeg"; mimes["mqv"] = "video/quicktime"; mimes["ms"] = "application/x-troff-ms"; mimes["msi"] = "application/octet-stream"; mimes["mso"] = "application/octet-stream"; mimes["mts"] = "video/vnd.dlna.mpeg-tts"; mimes["mtx"] = "application/xml"; mimes["mvb"] = "application/x-msmediaview"; mimes["mvc"] = "application/x-miva-compiled"; mimes["mxp"] = "application/x-mmxp"; mimes["nc"] = "application/x-netcdf"; mimes["nsc"] = "video/x-ms-asf"; mimes["nws"] = "message/rfc822"; mimes["ocx"] = "application/octet-stream"; mimes["oda"] = "application/oda"; mimes["odc"] = "text/x-ms-odc"; mimes["odh"] = "text/plain"; mimes["odl"] = "text/plain"; mimes["odp"] = "application/vnd.oasis.opendocument.presentation"; mimes["ods"] = "application/oleobject"; mimes["odt"] = "application/vnd.oasis.opendocument.text"; mimes["one"] = "application/onenote"; mimes["onea"] = "application/onenote"; mimes["onepkg"] = "application/onenote"; mimes["onetmp"] = "application/onenote"; mimes["onetoc"] = "application/onenote"; mimes["onetoc2"] = "application/onenote"; mimes["orderedtest"] = "application/xml"; mimes["osdx"] = "application/opensearchdescription+xml"; mimes["p10"] = "application/pkcs10"; mimes["p12"] = "application/x-pkcs12"; mimes["p7b"] = "application/x-pkcs7-certificates"; mimes["p7c"] = "application/pkcs7-mime"; mimes["p7m"] = "application/pkcs7-mime"; mimes["p7r"] = "application/x-pkcs7-certreqresp"; mimes["p7s"] = "application/pkcs7-signature"; mimes["pbm"] = "image/x-portable-bitmap"; mimes["pcast"] = "application/x-podcast"; mimes["pct"] = "image/pict"; mimes["pcx"] = "application/octet-stream"; mimes["pcz"] = "application/octet-stream"; mimes["pdf"] = "application/pdf"; mimes["pfb"] = "application/octet-stream"; mimes["pfm"] = "application/octet-stream"; mimes["pfx"] = "application/x-pkcs12"; mimes["pgm"] = "image/x-portable-graymap"; mimes["pic"] = "image/pict"; mimes["pict"] = "image/pict"; mimes["pkgdef"] = "text/plain"; mimes["pkgundef"] = "text/plain"; mimes["pko"] = "application/vnd.ms-pki.pko"; mimes["pls"] = "audio/scpls"; mimes["pma"] = "application/x-perfmon"; mimes["pmc"] = "application/x-perfmon"; mimes["pml"] = "application/x-perfmon"; mimes["pmr"] = "application/x-perfmon"; mimes["pmw"] = "application/x-perfmon"; mimes["png"] = "image/png"; mimes["pnm"] = "image/x-portable-anymap"; mimes["pnt"] = "image/x-macpaint"; mimes["pntg"] = "image/x-macpaint"; mimes["pnz"] = "image/png"; mimes["pot"] = "application/vnd.ms-powerpoint"; mimes["potm"] = "application/vnd.ms-powerpoint.template.macroEnabled.12"; mimes["potx"] = "application/vnd.openxmlformats-officedocument.presentationml.template"; mimes["ppa"] = "application/vnd.ms-powerpoint"; mimes["ppam"] = "application/vnd.ms-powerpoint.addin.macroEnabled.12"; mimes["ppm"] = "image/x-portable-pixmap"; mimes["pps"] = "application/vnd.ms-powerpoint"; mimes["ppsm"] = "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"; mimes["ppsx"] = "application/vnd.openxmlformats-officedocument.presentationml.slideshow"; mimes["ppt"] = "application/vnd.ms-powerpoint"; mimes["pptm"] = "application/vnd.ms-powerpoint.presentation.macroEnabled.12"; mimes["pptx"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; mimes["prf"] = "application/pics-rules"; mimes["prm"] = "application/octet-stream"; mimes["prx"] = "application/octet-stream"; mimes["ps"] = "application/postscript"; mimes["psc1"] = "application/PowerShell"; mimes["psd"] = "application/octet-stream"; mimes["psess"] = "application/xml"; mimes["psm"] = "application/octet-stream"; mimes["psp"] = "application/octet-stream"; mimes["pub"] = "application/x-mspublisher"; mimes["pwz"] = "application/vnd.ms-powerpoint"; mimes["qht"] = "text/x-html-insertion"; mimes["qhtm"] = "text/x-html-insertion"; mimes["qt"] = "video/quicktime"; mimes["qti"] = "image/x-quicktime"; mimes["qtif"] = "image/x-quicktime"; mimes["qtl"] = "application/x-quicktimeplayer"; mimes["qxd"] = "application/octet-stream"; mimes["ra"] = "audio/x-pn-realaudio"; mimes["ram"] = "audio/x-pn-realaudio"; mimes["rar"] = "application/octet-stream"; mimes["ras"] = "image/x-cmu-raster"; mimes["rat"] = "application/rat-file"; mimes["rc"] = "text/plain"; mimes["rc2"] = "text/plain"; mimes["rct"] = "text/plain"; mimes["rdlc"] = "application/xml"; mimes["resx"] = "application/xml"; mimes["rf"] = "image/vnd.rn-realflash"; mimes["rgb"] = "image/x-rgb"; mimes["rgs"] = "text/plain"; mimes["rm"] = "application/vnd.rn-realmedia"; mimes["rmi"] = "audio/mid"; mimes["rmp"] = "application/vnd.rn-rn_music_package"; mimes["roff"] = "application/x-troff"; mimes["rpm"] = "audio/x-pn-realaudio-plugin"; mimes["rqy"] = "text/x-ms-rqy"; mimes["rtf"] = "application/rtf"; mimes["rtx"] = "text/richtext"; mimes["ruleset"] = "application/xml"; mimes["s"] = "text/plain"; mimes["safariextz"] = "application/x-safari-safariextz"; mimes["scd"] = "application/x-msschedule"; mimes["sct"] = "text/scriptlet"; mimes["sd2"] = "audio/x-sd2"; mimes["sdp"] = "application/sdp"; mimes["sea"] = "application/octet-stream"; mimes["searchConnector-ms"] = "application/windows-search-connector+xml"; mimes["setpay"] = "application/set-payment-initiation"; mimes["setreg"] = "application/set-registration-initiation"; mimes["settings"] = "application/xml"; mimes["sgimb"] = "application/x-sgimb"; mimes["sgml"] = "text/sgml"; mimes["sh"] = "application/x-sh"; mimes["shar"] = "application/x-shar"; mimes["shtml"] = "text/html"; mimes["sit"] = "application/x-stuffit"; mimes["sitemap"] = "application/xml"; mimes["skin"] = "application/xml"; mimes["sldm"] = "application/vnd.ms-powerpoint.slide.macroEnabled.12"; mimes["sldx"] = "application/vnd.openxmlformats-officedocument.presentationml.slide"; mimes["slk"] = "application/vnd.ms-excel"; mimes["sln"] = "text/plain"; mimes["slupkg-ms"] = "application/x-ms-license"; mimes["smd"] = "audio/x-smd"; mimes["smi"] = "application/octet-stream"; mimes["smx"] = "audio/x-smd"; mimes["smz"] = "audio/x-smd"; mimes["snd"] = "audio/basic"; mimes["snippet"] = "application/xml"; mimes["snp"] = "application/octet-stream"; mimes["sol"] = "text/plain"; mimes["sor"] = "text/plain"; mimes["spc"] = "application/x-pkcs7-certificates"; mimes["spl"] = "application/futuresplash"; mimes["src"] = "application/x-wais-source"; mimes["srf"] = "text/plain"; mimes["SSISDeploymentManifest"] = "text/xml"; mimes["ssm"] = "application/streamingmedia"; mimes["sst"] = "application/vnd.ms-pki.certstore"; mimes["stl"] = "application/vnd.ms-pki.stl"; mimes["sv4cpio"] = "application/x-sv4cpio"; mimes["sv4crc"] = "application/x-sv4crc"; mimes["svc"] = "application/xml"; mimes["swf"] = "application/x-shockwave-flash"; mimes["t"] = "application/x-troff"; mimes["tar"] = "application/x-tar"; mimes["tcl"] = "application/x-tcl"; mimes["testrunconfig"] = "application/xml"; mimes["testsettings"] = "application/xml"; mimes["tex"] = "application/x-tex"; mimes["texi"] = "application/x-texinfo"; mimes["texinfo"] = "application/x-texinfo"; mimes["tgz"] = "application/x-compressed"; mimes["thmx"] = "application/vnd.ms-officetheme"; mimes["thn"] = "application/octet-stream"; mimes["tif"] = "image/tiff"; mimes["tiff"] = "image/tiff"; mimes["tlh"] = "text/plain"; mimes["tli"] = "text/plain"; mimes["toc"] = "application/octet-stream"; mimes["tr"] = "application/x-troff"; mimes["trm"] = "application/x-msterminal"; mimes["trx"] = "application/xml"; mimes["ts"] = "video/vnd.dlna.mpeg-tts"; mimes["tsv"] = "text/tab-separated-values"; mimes["ttf"] = "application/octet-stream"; mimes["tts"] = "video/vnd.dlna.mpeg-tts"; mimes["txt"] = "text/plain"; mimes["u32"] = "application/octet-stream"; mimes["uls"] = "text/iuls"; mimes["user"] = "text/plain"; mimes["ustar"] = "application/x-ustar"; mimes["vb"] = "text/plain"; mimes["vbdproj"] = "text/plain"; mimes["vbk"] = "video/mpeg"; mimes["vbproj"] = "text/plain"; mimes["vbs"] = "text/vbscript"; mimes["vcf"] = "text/x-vcard"; mimes["vcproj"] = "Application/xml"; mimes["vcs"] = "text/plain"; mimes["vcxproj"] = "Application/xml"; mimes["vddproj"] = "text/plain"; mimes["vdp"] = "text/plain"; mimes["vdproj"] = "text/plain"; mimes["vdx"] = "application/vnd.ms-visio.viewer"; mimes["vml"] = "text/xml"; mimes["vscontent"] = "application/xml"; mimes["vsct"] = "text/xml"; mimes["vsd"] = "application/vnd.visio"; mimes["vsi"] = "application/ms-vsi"; mimes["vsix"] = "application/vsix"; mimes["vsixlangpack"] = "text/xml"; mimes["vsixmanifest"] = "text/xml"; mimes["vsmdi"] = "application/xml"; mimes["vspscc"] = "text/plain"; mimes["vss"] = "application/vnd.visio"; mimes["vsscc"] = "text/plain"; mimes["vssettings"] = "text/xml"; mimes["vssscc"] = "text/plain"; mimes["vst"] = "application/vnd.visio"; mimes["vstemplate"] = "text/xml"; mimes["vsto"] = "application/x-ms-vsto"; mimes["vsw"] = "application/vnd.visio"; mimes["vsx"] = "application/vnd.visio"; mimes["vtx"] = "application/vnd.visio"; mimes["wav"] = "audio/wav"; mimes["wave"] = "audio/wav"; mimes["wax"] = "audio/x-ms-wax"; mimes["wbk"] = "application/msword"; mimes["wbmp"] = "image/vnd.wap.wbmp"; mimes["wcm"] = "application/vnd.ms-works"; mimes["wdb"] = "application/vnd.ms-works"; mimes["wdp"] = "image/vnd.ms-photo"; mimes["webarchive"] = "application/x-safari-webarchive"; mimes["webtest"] = "application/xml"; mimes["wiq"] = "application/xml"; mimes["wiz"] = "application/msword"; mimes["wks"] = "application/vnd.ms-works"; mimes["WLMP"] = "application/wlmoviemaker"; mimes["wlpginstall"] = "application/x-wlpg-detect"; mimes["wlpginstall3"] = "application/x-wlpg3-detect"; mimes["wm"] = "video/x-ms-wm"; mimes["wma"] = "audio/x-ms-wma"; mimes["wmd"] = "application/x-ms-wmd"; mimes["wmf"] = "application/x-msmetafile"; mimes["wml"] = "text/vnd.wap.wml"; mimes["wmlc"] = "application/vnd.wap.wmlc"; mimes["wmls"] = "text/vnd.wap.wmlscript"; mimes["wmlsc"] = "application/vnd.wap.wmlscriptc"; mimes["wmp"] = "video/x-ms-wmp"; mimes["wmv"] = "video/x-ms-wmv"; mimes["wmx"] = "video/x-ms-wmx"; mimes["wmz"] = "application/x-ms-wmz"; mimes["wpl"] = "application/vnd.ms-wpl"; mimes["wps"] = "application/vnd.ms-works"; mimes["wri"] = "application/x-mswrite"; mimes["wrl"] = "x-world/x-vrml"; mimes["wrz"] = "x-world/x-vrml"; mimes["wsc"] = "text/scriptlet"; mimes["wsdl"] = "text/xml"; mimes["wvx"] = "video/x-ms-wvx"; mimes["x"] = "application/directx"; mimes["xaf"] = "x-world/x-vrml"; mimes["xaml"] = "application/xaml+xml"; mimes["xap"] = "application/x-silverlight-app"; mimes["xbap"] = "application/x-ms-xbap"; mimes["xbm"] = "image/x-xbitmap"; mimes["xdr"] = "text/plain"; mimes["xht"] = "application/xhtml+xml"; mimes["xhtml"] = "application/xhtml+xml"; mimes["xla"] = "application/vnd.ms-excel"; mimes["xlam"] = "application/vnd.ms-excel.addin.macroEnabled.12"; mimes["xlc"] = "application/vnd.ms-excel"; mimes["xld"] = "application/vnd.ms-excel"; mimes["xlk"] = "application/vnd.ms-excel"; mimes["xll"] = "application/vnd.ms-excel"; mimes["xlm"] = "application/vnd.ms-excel"; mimes["xls"] = "application/vnd.ms-excel"; mimes["xlsb"] = "application/vnd.ms-excel.sheet.binary.macroEnabled.12"; mimes["xlsm"] = "application/vnd.ms-excel.sheet.macroEnabled.12"; mimes["xlsx"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; mimes["xlt"] = "application/vnd.ms-excel"; mimes["xltm"] = "application/vnd.ms-excel.template.macroEnabled.12"; mimes["xltx"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.template"; mimes["xlw"] = "application/vnd.ms-excel"; mimes["xml"] = "text/xml"; mimes["xmta"] = "application/xml"; mimes["xof"] = "x-world/x-vrml"; mimes["XOML"] = "text/plain"; mimes["xpm"] = "image/x-xpixmap"; mimes["xps"] = "application/vnd.ms-xpsdocument"; mimes["xrm-ms"] = "text/xml"; mimes["xsc"] = "application/xml"; mimes["xsd"] = "text/xml"; mimes["xsf"] = "text/xml"; mimes["xsl"] = "text/xml"; mimes["xslt"] = "text/xml"; mimes["xsn"] = "application/octet-stream"; mimes["xss"] = "application/xml"; mimes["xtp"] = "application/octet-stream"; mimes["xwd"] = "image/x-xwindowdump"; mimes["z"] = "application/x-compress"; mimes["zip"] = "application/x-zip-compressed";
}
[/code]
how to server static file, with CSS, JavaScript, HTML?