Re: [Express-js] Font Awesome + Express + MIME type

2,478 views
Skip to first unread message

Ryan Schmidt

unread,
Jan 4, 2013, 2:53:25 PM1/4/13
to expre...@googlegroups.com

On Jan 4, 2013, at 11:47, Davis Ford wrote:

> Hi, I'm trying to use Font Awesome with an Express app http://fortawesome.github.com/
>
> In Chrome, I am getting
>
> Resource interpreted as Font but transferred with MIME type text/html: "http://localhost:9000/font/fontawesome-webfont.woff".

It doesn't answer your specific question, but it might answer the underlying need: you could use a hosted copy of Font Awesome, for example the one available here:

http://www.bootstrapcdn.com/


Dida

unread,
Sep 20, 2013, 12:50:40 AM9/20/13
to expre...@googlegroups.com
Hi Francisco,

On the SO link, the solution is just by installing mime via npm. Are you sure there's no additional configuration needed? I have installed other npm modules with mime as dependencies (by this, I'm expecting that mime is already installed), but doesn't solve the issue. Can you please elaborate your answer?

Thanks,
Dida


On Saturday, June 1, 2013 2:53:24 AM UTC+8, Francisco Méndez Vilas wrote:
Hi Davis!


Hope it helps!
Fran


El viernes, 4 de enero de 2013 18:47:13 UTC+1, Davis Ford escribió:
Hi, I'm trying to use Font Awesome with an Express app http://fortawesome.github.com/

In Chrome, I am getting 

Resource interpreted as Font but transferred with MIME type text/html: "http://localhost:9000/font/fontawesome-webfont.woff".

I tried configuring express as:

express.static.mime.define({'application/x-font-woff': ['woff']}); express.static.mime.define({'application/x-font-ttf': ['ttf']}); express.static.mime.define({'application/vnd.ms-fontobject': ['eot']}); express.static.mime.define({'font/opentype': ['otf']});

..and I am using the static middleware

What do I need to get the server to recognize the mime type and set the header appropriately?


Reply all
Reply to author
Forward
0 new messages