Socket
Socket
Sign inDemoInstall

base-domain-loopback

Package Overview
Dependencies
31
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    base-domain-loopback

## creates custom model-definitions for loopback-with-admin


Version published
Maintainers
1
Install size
6.60 MB
Created

Readme

Source

base-domain-loopback

Domain-Driven Design with loopback

API documentation

latest API documentation Page

extends base-domain

installation

$ npm install base-domain-loopback

usage

definition

model definition is the same as base-domain

domain-dir/player.coffee

Domain = require('base-domain-loopback')

class Player extends Domain.Entity
    @properties:
        name: @TYPES.STRING

module.exports = Player

domain-dir/player-repository.coffee

Domain = require('base-domain-loopback')

class PlayerRepository extends Domain.LoopbackUserRepository
    @aclType: 'owner' # access type. see README in loopback-with-admin

module.exports = PlayerRepository

main.coffee

domain = require('base-domain-loopback').createInstance
    dirname: 'domain-dir'
    baseURL: 'localhost:4157/api'

run loopback server with loopback-with-admin

domain = require('base-domain-loopback').createInstance dirname: 'domain-dir'

modelDefinitions = domain.getModelDefinitions()

config =
    server:
        port: 4157

require('loopback-with-admin').run(modelDefinitions, config)

FAQs

Last updated on 16 Nov 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc