Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !8429

Update proxying-api-requests-in-development.md

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/chybisov/patch-1 into main Feb 05, 2020
  • Overview 2
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: chybisov

We should always pass path parameter to app.use and context parameter to proxy, which are almost always the same, except cases mentioned in third Note.

app.use mounts the specified middleware function at the specified path: the middleware function is executed when the base of the requested path matches path.

proxy first parameter specify context (part of url) which then will be checked whether request url has it or not. This is not necessarily with http requests, but will break WebpackDevServer sockjs-node HMR functionality when we try to proxy some of our own websocket requests. Default context is '/' and because all urls has '/', /sockjs-node from WDS also will be proxied, but it shouldn't. http requests work without specifying context because no one else sends http requests.

Related to this comment.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/chybisov/patch-1