Skip to content

Watching doesn't work on Windows 10 with Cygwin #355

Closed
@halfzebra

Description

@halfzebra

Cygwin allows using Unix paths under Windows.

$ json-server --watch api-mock/data.json --port 3000
  • json-server will attempt to watch api-mock/data.json
  • chokidar in change event will refer to a change in api-mock\data.json, preventing json-server from restarting the server

Possible solution will require a change in src/cli/run.js

      chokidar
        .watch(path.dirname(source))
        .on('change', function (file) {
          if (path.resolve(file) === path.resolve(source)) { // resolve paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions