我正在使用 node-mime 为 woff 字体设置正确的 mime 类型。还是行不通。任何帮助将非常感激。
var express = require('express')
var mime = require('mime');
...
express.static.mime.define({
'application/x-font-woff': ['woff'],
'application/font-woff': ['woff']
});
干杯@harishvc
您可能错过了提供字体的正确途径。serve-static 已经提供了正确的 mime 类型。
您可以使用serve-static轻松地在项目中提供静态资源。如果您已经在使用serve-static
,请检查您是否真的在请求时发送字体。