Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const argv = require('minimist')(process.argv.slice(2));
const d = argv.d;
require('seneca')()
.use('csv', { d })
// listen for role:math messages
// IMPORTANT: must match client
.listen({ type: 'tcp', pin: 'role:csv', port: 10202 });
'use strict'
var type = process.argv[2]
console.log('TYPE:' + type)
require('seneca')()
.use('../transport.js')
.use('foo')
.listen({type: type})
var HOST = process.env.HOST || process.argv[2] || '127.0.0.1'
var BASES = (process.env.BASES || process.argv[3] || '').split(',')
require('seneca')({
tag: 'post',
internal: {logger: require('seneca-demo-logger')},
debug: { short_logs: true }
})
//.use('zipkin-tracer', {sampling:1})
.use('entity')
.use('post-logic')
.use('mesh',{
pin: 'post:*',
bases: BASES,
host: HOST
})
.ready(function(){
console.log(this.id)
var HOST = process.env.HOST || process.argv[2] || '127.0.0.1'
var BASES = (process.env.BASES || process.argv[3] || '').split(',')
var SILENT = process.env.SILENT || process.argv[4] || 'true'
require('seneca')({
tag: 'index',
internal: {logger: require('seneca-demo-logger')},
debug: {short_logs: true}
})
//.use('zipkin-tracer', {sampling:1})
.use('index-logic')
.add('info:entry', function(msg,done){
delete msg.info
this.act('search:insert',msg,done)
})
.use('mesh',{
listen:[
{pin: 'search:*'},
require('seneca')({tag:'base'})
//.test('print')
.use('seneca-repl')
.use('..',{
base:true,
monitor:true
})
var SHARD = process.env.SHARD || process.argv[2] || 0
var HOST = process.env.HOST || process.argv[3] || '127.0.0.1'
var BASES = (process.env.BASES || process.argv[4] || '').split(',')
var SILENT = process.env.SILENT || process.argv[5] || 'true'
require('seneca')({
tag: 'timeline'+SHARD,
internal: {logger: require('seneca-demo-logger')},
debug: {short_logs:true}
})
.use('zipkin-tracer', {sampling:1})
.use('entity')
.use('timeline-logic')
.use('mesh',{
pin: 'timeline:*,shard:'+SHARD,
bases: BASES,
host: HOST,
sneeze: {
silent:JSON.parse(SILENT),
swim: {interval: 1111}
}
})
var HOST = process.env.HOST || process.argv[2] || '127.0.0.1'
var BASES = (process.env.BASES || process.argv[3] || '').split(',')
var SILENT = process.env.SILENT || process.argv[4] || 'true'
require('seneca')({
tag: 'fanout',
internal: {logger: require('seneca-demo-logger')},
debug: {short_logs: true}
})
//.use('zipkin-tracer', {sampling:1})
.use('fanout-logic')
.add('info:entry', function(msg,done){
delete msg.info
this.act('fanout:entry',msg,done)
})
.use('mesh',{
listen:[
{pin: 'fanout:*'},
{pin: 'info:entry', model:'observe'}
require('seneca')()
.use('./imagesPluginAPI.js')
.listen({ type: 'tcp', pin: 'role:images', port: 10204, timeout: 60000 });
require('seneca')()
.use('user')
.listen(10201)
.ready(function(){
this.act({role:'user',cmd:'register',nick:'u1',name:'U1',password:'u1'})
})
var seneca = require( 'seneca' )()
.use( 'api' )
.client( { type:'tcp', pin:'role:math' } )
var app = require( 'express' )()
.use( require('body-parser').json() )
.use( seneca.export( 'web' ) )
.listen(3000)