nodejs读取图片返回给浏览器显示
l"}处理方法一、静态返回资源原理:使用node.js的fs.readFile来处理。根据请求地址,转换成实际的文件地址。判断文件是否存在,不存在返回404,存在则读取文件 ,并返回文件。//设置请求的返回头type,content的type类型列表见上面response.setHeader("Content-Type", contentType);//格式必须为 binary 否则会出错var content = fs.readFileSync(url,"binary");response.writeHead(200, "Ok");response.write(content,"binar