Skip to content
This repository was archived by the owner on Jun 14, 2026. It is now read-only.
This repository was archived by the owner on Jun 14, 2026. It is now read-only.

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

Description

@elhigu

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
      }
    }
  ]
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions