serve-fontmin
v0.1.3
Published
fontmin serving middleware
Downloads
10
Readme
serve-fontmin
fontmin serving middleware
Usage
server
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);
});
browser
basic
${pathname}/${filename}.css?text=${text}
optional font-family
${pathname}/${filename}.css?text=${text}&name=${fontFamily}
API
fontmin(path, [options])
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.
Example
$ cd example
$ npm i
$ node app.js
open http://127.0.0.1:8090/index.html
Related
License
MIT © fontmin