Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ee-soa-service

Package Overview
Dependencies
Maintainers
2
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-soa-service

abstract service implementation

  • 2.12.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
Maintainers
2
Weekly downloads
 
Created
Source

EE-SOA-SERVICE

include in package.json

  • "ee-soa-service" : "version"
  • "ee-class" : "0.4.*"

service structure

you may use the default service structure for your service-package:

+-- Controller (dir for your custom controllers)
| +-- TestController.js
+-- lib
| +-- Service.js (your service file, see below)
+-- test (your tests)
+-- config.js.dist (your config.dist file, for testing etc.)
+-- index.js
+-- LICENCE
+-- package.json
+-- README.md
+-- service.js (config file)
+-- test.js (if you need a test file)


/lib/Service.js

!function() {
    'use strict';

    var Class     = require('ee-class')
        , Service = require('ee-soa-service');

    module.exports = new Class({
        inherits: Service

        , name: 'serviceName'
        , init: function init(options) {
            this.options    = options || {};
            this.serviceDir = __dirname + '/../';

            init.parent(options);
        }

    });

}();


/Controller/TestController.js (with a DefaultORMController)

!function() {
    'use strict';

    var Class                  = require('ee-class')
        , DefaultORMController = require('ee-soa-service').DefaultORMController;

    module.exports = new Class({
        inherits: DefaultORMController

        , init: function init(options) {
            this.options       = options || {};
            this.options.table = 'event';

            init.parent(options);
        }

    });

}();


/Service.js

module.exports = {
    //controller: ['TestController'] //[optional] if empty we try to load all user created controllers
    tables: ['user'] //define tables from wich defaultcontrollers will be generated
    //, controllerDir: 'Controller' //[optional] default to 'Controller'
};

Keywords

FAQs

Package last updated on 09 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc