Skip to content

Commit

Permalink
fix: add ROUTER_MODE env var for router.mode (fixes #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
iquidus committed Nov 5, 2019
1 parent 5752370 commit c89b38b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ A vue.js based OpenRPC viewer and editor.
npm install
```

### Environment Variables

* ROUTER_MODE: [vue-router history mode](https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations) option ('history', 'hash'). default: hash.
* BASE_URL: [base URL](https://router.vuejs.org/api/#base) of the app. For example, if the entire single page application is served under /d0x/, then base should use the value "/d0x/". default "/"

### Compiles and hot-reloads for development
```
npm run serve
Expand Down
4 changes: 2 additions & 2 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import View from '@/views/View.vue'
Vue.use(Router)

export default new Router({
mode: 'history',
base: process.env.BASE_URL,
mode: process.env.ROUTER_MODE || 'hash',
base: process.env.BASE_URL || '/',
routes: [
{
path: '/',
Expand Down

0 comments on commit c89b38b

Please sign in to comment.