Skip to content

Commit 6db9651

Browse files
committed
fix: Serve js files with utf-8 encoding
1 parent 77d0a47 commit 6db9651

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/backend/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ const port = PORT;
1616
app.use(bodyParser.json());
1717

1818
if(NODE_ENV === 'production') {
19+
app.use(function(req, res, next) {
20+
if (/.*\.js/.test(req.path)) {
21+
res.charset = "utf-8";
22+
}
23+
next();
24+
});
1925
app.use(express.static(`${__dirname}/public`));
2026
}
2127

0 commit comments

Comments
 (0)