live-server icon indicating copy to clipboard operation
live-server copied to clipboard

live-server --spa brakes mime

Open daggerok opened this issue 5 years ago • 1 comments

Before submitting an issue, please, see https://github.com/tapio/live-server#troubleshooting

Issue description

if I'm running live-server with option --spa I'm getting error:

image

if I'm removing --spa option everything is back to normal

Software details

  • Command line used for launching live-server: live-server --spa ./src
  • OS: latest mac os x
  • Browser (if browser related): not related, but chrome
  • Node.js version: lts: node: v8.11.3, npm: 6.1.0
  • live-server version: live-server 1.2.0

daggerok avatar Jul 25 '18 21:07 daggerok

to handle my /xxx urls, I don't use thisspa option, instead I add https://github.com/bripkens/connect-history-api-fallback middleware

const liveServer = require('live-server');
const historyApiFallback = require('connect-history-api-fallback');

const params = {
  //...my other options
  middleware: [historyApiFallback()]
};

liveServer.start(params);

chrisdugne avatar Feb 23 '21 22:02 chrisdugne