gruntjs/grunt-contrib-connect

Is it possible to configure the mime type returned by grunt-contrib-connect?

Stefany93 opened this issue · 1 comments

I need to serve files without extensions as text/html

SOLUTION:

 options: {
    port: 8800,
    hostname: 'localhost',
        middleware: function(connect, options, middlewares) {
                    middlewares.unshift(function(req, res, next) {
                        res.setHeader('Content-Type', 'text/html');
                        return next();
                    });

                    return middlewares;
                },
  }