Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ fs.readdirSync(__dirname).forEach(file => {

app.use(express.static(__dirname))

const host = process.env.HOST || 'localhost'
const port = process.env.PORT || 8080
module.exports = app.listen(port, () => {
console.log(`Server listening on http://localhost:${port}, Ctrl+C to stop`)
module.exports = app.listen(port, host, () => {
console.log(`Server listening on http://${host}:${port}, Ctrl+C to stop`)
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"lint-staged": "^8.2.0",
"nightwatch": "^1.1.13",
"nightwatch-helpers": "^1.0.0",
"path-to-regexp": "^1.7.0",
"path-to-regexp": "^1.8.0",
"rollup": "^1.20.1",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.0.2",
Expand Down
6 changes: 3 additions & 3 deletions test/unit/specs/location.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ describe('Location utils', () => {
})

it('relative params (non-named)', () => {
const loc = normalizeLocation({ params: { lang: 'fr' }}, {
const loc = normalizeLocation({ params: { lang: 'FR' }}, {
path: '/en/foo',
params: { lang: 'en', id: 'foo' },
matched: [{ path: '/:lang/:id' }]
matched: [{ path: '/:lang(en|fr)/:id' }]
})
expect(loc._normalized).toBe(true)
expect(loc.path).toBe('/fr/foo')
expect(loc.path).toBe('/FR/foo')
})

it('relative append', () => {
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7769,13 +7769,20 @@ path-to-regexp@0.1.7:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=

path-to-regexp@^1.0.3, path-to-regexp@^1.7.0:
path-to-regexp@^1.0.3:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
integrity sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=
dependencies:
isarray "0.0.1"

path-to-regexp@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
dependencies:
isarray "0.0.1"

path-type@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
Expand Down