Reputation: 1979
I try to mirror my public CDN server (Microsoft IIS) for local development with Node.js. I have this server:
var express = require('express');
var app = express();
app.use(express.static('../../resources'));
var server = app.listen(8282);
and request the glyphicons css file in my website, which loads a font file. but for some reason I got no data in chrome, regardless of the font type. everything is working fine on the public CDN.
Whats wrong with the node server?
Upvotes: 1
Views: 107
Reputation: 1979
It is simple:
loading font files will go Cross-Origin so I need to set the Access-Control-Allow-Origin header:
res.setHeader('Access-Control-Allow-Origin', '*');
Upvotes: 1