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

Way to create service where all code / routes / migrations comes from npm dependency #5

Open
elhigu opened this issue Dec 19, 2015 · 0 comments

Comments

@elhigu
Copy link

elhigu commented Dec 19, 2015

These would be maybe some things called pluggable services.

One would just need to add e.g. dodo-services-stripey-payment and maybe add one liner somewhere e.g. to gulp file to tell system to use that.

It will register new task, which allows to create new service to services directory, which contains configuration file. However configuration file will refer directly paths under node_modules (migrations / populate data / routes etc.)

Paths could be exposed by plugin module the same way that normal plugins exposes paths to features, so in pluggable service configuration it would just refer paths got from require to prevent directly use of nasty ../../node_modules/... relative paths.

module.exports = {
  port: process.env.PORT || 8083,
  features: [
    {
      feature: 'objection',
      config: {
        knex: {
          connection: {
            database: 'stripey-payments'
          },
          migrations: {
            directory: paymentService.migrationsPath
          }
        },
        modelPaths: paymentService.modelPaths
      }
    }, {
      feature: 'route',
      config: {
        routePaths: paymentService.routePaths
      }
    }
  ]
};
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

1 participant