Skip to content

chore(server): redirect if router.base specified in development #8313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

atinux
Copy link
Member

@atinux atinux commented Nov 7, 2020

Types of changes

DX improvement.

Description

When we specify router.base:

// nuxt.config.js
export default {
  router: {
    base: '/hello/'
  }
}

When running nuxt dev, accessing http://localhost:3000 will display: Cannot GET /

With this PR, it will redirect to http://localhost:3000/hello/ and log to the console:

Screenshot 2020-11-07 at 17 03 15

Checklist:

  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

Sorry, something went wrong.

@atinux atinux changed the title chore(server): add server middleware in development in development chore(server): redirect if router.base specified in development Nov 7, 2020
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pi0 pi0 merged commit e601f0a into dev Nov 9, 2020
@pi0 pi0 deleted the dx/router-base-dev branch November 9, 2020 17:17
@pi0 pi0 mentioned this pull request Nov 30, 2020
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants