johnpapa / lite-server

Lightweight node server
MIT License
2.31k stars 267 forks source link

Disable SPA handling? #193

Open kevinrenskers opened 3 years ago

kevinrenskers commented 3 years ago

This seems like a great project, but I can't get simple subfolder paths to work for a static HTML website. No JS, no SPA.

Start server with lite-server --baseDir="deploy"

When I then open http://localhost:3002/articles/, I get the home page of the site. I have to specially open http://localhost:3002/articles/index.html to see the page I expected. How can I solve this? Seems like weird behavior? 🤔

kevinrenskers commented 3 years ago

Aha, this seems to do it.

module.exports = {
  server: {
    middleware: {
      1: null,
    },
  },
};

lite-server --baseDir="deploy" -c "./bs-config.js"

It would be great if this was just a CLI option, but at least it works now :)