Express sending assets with wrong MIME type

前端 未结 3 876
旧巷少年郎
旧巷少年郎 2021-01-16 01:24

Using Express to serve a Vue.js webpack app, I am receiving the following error after deploy: Is my code for serving the app is the issue here?

app.use(helm         


        
3条回答
  •  -上瘾入骨i
    2021-01-16 01:41

    Yes same problems over here.

    I'm using ecstatic (still with express) now. I'm not sure if this is the solution (I'm not on the machine that made the error possible).

    Will try it tommorow on the 'error' machine.

    const express = require('express');
    const ecstatic = require('ecstatic');
    const http = require('http');
    
    const app = express();
    
    app.use(ecstatic({
      root: `${__dirname}/public`,
      showdir: false,
    }));
    
    http.createServer(app).listen(8080);
    
    console.log('See if its cool on -> :8080');
    

提交回复
热议问题