Closed yantakus closed 10 years ago
I have a problem with encoding of .js file served by built-in server. How can I set the Content-type header to UTF-8?
I found https://github.com/luics/connect-header, but can you help me to set it up?
I tried this:
var connect = require('connect'); var app = connect(); var header = require('connect-header'); function setContentType(){ app.use(header({ 'Content-type':'UTF-8' })); } browserSync.init(files, { server: { middleware: [ setContentType ] } });
But server just hangs, when I call gulp serve (browser page opens, but nothing appears, just loading forever).
gulp serve
Thank you!
Did it turn out to not be an issue?
Yes, my issue turned out to be not with encoding.
Ok cool - thanks for closing :)
I have a problem with encoding of .js file served by built-in server. How can I set the Content-type header to UTF-8?
I found https://github.com/luics/connect-header, but can you help me to set it up?
I tried this:
But server just hangs, when I call
gulp serve
(browser page opens, but nothing appears, just loading forever).Thank you!