nestjs / serve-static

Serve static websites (SPA's) using Nest framework (node.js) šŸ„¦

Home Page:https://nestjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Send correct mime-type header with served files

mlandisbqs opened this issue Ā· comments

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

We're using this plugin to serve up the client-side app and seeing console warnings (edit: these are only warnings) because .css files served do not have the correct mime-type. I don't see an ability in the options to map file extensions to mime types in order to solve this.

Expected behavior

.css file should be served with a mime-type of text/css. I believe we should be able to map these mime types according to extension.

Minimal reproduction of the problem with instructions

image

What is the motivation / use case for changing the behavior?

Send the correct mime-types in the headers for serving static files

Environment


Nest version: 7.4.2

 
For Tooling issues:
- Node version: v12.18.3  
- Platform: Mac 

Others:

Cannot Reproduce.