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

Revisit default paths #371

Closed
eduardoboucas opened this Issue Dec 8, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@eduardoboucas
Copy link
Member

eduardoboucas commented Dec 8, 2017

In config.js:

  paths: {
    collections: {
      doc: 'The relative or absolute path to collection specification files',
      format: String,
      default: __dirname + '/workspace/collections'
    }
  }

Because __dirname refers to the path where the file is located, the default collection path will be node_modules/@dadi/api/workspace/collections when you're using API as an NPM module, which is never what you want (is it?).

In practice, this means that unless users override this path in their configs, they won't be able to add collections. The same applies to custom endpoints and hooks.

Should we change this so that the default becomes {USER_DIRECTORY}/workspace and not {NODE_MODULE_DIRECTORY}/workspace?

/cc @jimlambie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment