当前位置:

近期开发简单web服务器的一些总结

首先,说一下web服务器的字符集,最好默认UTF8,然后,MIME映射关系,只考虑静态页面的我用到了如下一些,供大家参考:

  { "htm", "text/html" },
            {"js","application/x-javascript"},
            {"go","application/x-javascript"},
            {"map","application/x-navimap"},
            {"svg","image/svg+xml"},
            {"snippets","application/x-javascript"},
            {"ttf","application/octet-stream"},
            {"woff","application/x-font-woff"},
            {"ico","image/vnd.microsoft.icon"},
            {"cur","image/vnd.microsoft.icon"},
            { "html", "text/html" },
            { "xml", "text/xml" },
            { "txt", "text/plain" },
            { "css", "text/css" },
            { "png", "image/png" },
            { "gif", "image/gif" },
            { "jpg", "image/jpg" },
            { "jpeg", "image/jpeg" },
            { "zip", "application/zip"}

光锥极客  2014-07-21 7:57  阅读量:2678