fontmin serving middleware
var express = require('express');
var fontmin = require('serve-fontmin');
var app = express();
app.use('/static', fontmin('public/font'));
var server = app.listen(8090, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
basic
${pathname}/${filename}.css?text=${text}
optional font-family
${pathname}/${filename}.css?text=${text}&name=${fontFamily}
Path:
source font path.
Options:
headers
headers of response to serve, optional.oppressor
compression response, defaults false.base64
inject base64 data:application/x-font-ttf; (gzip font with css). defaults falsestorage
storage plugin, if you want to use a Storage Service likeAWS
,BOS
insteadfs
, optional.
$ cd example
$ npm i
$ node app.js
open http://127.0.0.1:8090/index.html
MIT © fontmin