Skip to content

Commit

Permalink
fix: add content-type for html files on dev server (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
imyelo committed Jul 30, 2021
1 parent 9d0f72d commit aa02b01
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/slidev/node/plugins/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function createConfigPlugin(options: ResolvedSlidevOptions): Plugin {
return () => {
server.middlewares.use(async(req, res, next) => {
if (req.url!.endsWith('.html')) {
res.setHeader('Content-Type', 'text/html')
res.statusCode = 200
res.end(await getIndexHtml(options))
return
Expand Down

0 comments on commit aa02b01

Please sign in to comment.