Skip to content

Instantly share code, notes, and snippets.

@dohoons
Created October 6, 2017 11:23
Show Gist options
  • Save dohoons/6464c0a55eb837c874b44ae71e120cbe to your computer and use it in GitHub Desktop.
Save dohoons/6464c0a55eb837c874b44ae71e120cbe to your computer and use it in GitHub Desktop.
gulp-webserver charset euc-kr
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var mime = require('mime-types');
gulp.task('default', function() {
gulp.src('./').pipe(webserver({
host: '0.0.0.0',
port: 3000,
livereload: false,
directoryListing: false,
open: false,
middleware: function(req, res, next) {
res.setHeader("Content-Type",`${mime.lookup(req.url)}; charset=euc-kr`);
next();
}
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment