Http-server: "History Mode" of Vue.js

Created on 25 Jun 2019  路  3Comments  路  Source: http-party/http-server

Do you want to request a feature or report a bug?
feature

If the issue is a feature request, what is the motivation / use case for it?
Vuejs has a "history mode"
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

There are some config for the servers like Apache. But I don't know how to implement it for http-server. If there is a way to do that, I would like to know. If not, this can be a feature request.

Tell us about your environment

  • http-server version:
  • Platform: Mac OS X

Most helpful comment

@thornjad Thank you very much. I checked the comments, and I saw the serve project. I tried with rewrite rules and it worked!

For those who is interested;

serve.json:

{
  "rewrites": [{
    "source": "**",
    "destination": "/index.html"
  }]
}

and;
npx serve

All 3 comments

Is this the same as #318?

@thornjad Thank you very much. I checked the comments, and I saw the serve project. I tried with rewrite rules and it worked!

For those who is interested;

serve.json:

{
  "rewrites": [{
    "source": "**",
    "destination": "/index.html"
  }]
}

and;
npx serve

Shortcut: -s rewrite all not-found requests to index.html

serve -s PATH
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dKab picture dKab  路  7Comments

asaf picture asaf  路  6Comments

jondlm picture jondlm  路  6Comments

laughinghan picture laughinghan  路  5Comments

frank-dspeed picture frank-dspeed  路  7Comments