Skip to content
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

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

Closed
halfzebra opened this issue Sep 10, 2016 · 1 comment
Closed

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

halfzebra opened this issue Sep 10, 2016 · 1 comment

Comments

@halfzebra
Copy link
Contributor

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
@typicode
Copy link
Owner

Closing since the fix has been merged. Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants