Skip to content

Instantly share code, notes, and snippets.

View kianenigma's full-sized avatar

Kian Paimani kianenigma

View GitHub Profile
xyz dev -c xyz.json
/project-dir
- client.js
- worker.js
- front.js
- xyz.json
// and probably:
- node_modules
- package.json
- /log
- [email protected]:4000.log
{
"nodes": [
{
"path": "./front.js",
"port": 4000,
"stdio": "file"
},
{
"path": "./client.js",
"port": 5000,
$npm install -g xyz-cli
front.call({
servicePath: req.query['service_path']}, () => {...})
front.js log
[2017-4-2 17:8:17][[email protected]:4000] warn :: Sending a message to /task/io from first find strategy failed (Local Response)
$ curl -X POST -i "http://localhost:4001/service?service_path=task/io"
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 31
ETag: W/"1f-5BgiCd8igfyPhK/4unDH1iI+hM0"
Date: Sun, 02 Apr 2017 12:38:17 GMT
Connection: keep-alive
{"err":"Not Found","body":null}%
const express = require('express')
const XYZ = require('xyz-core')
const app = express()
const EXPRES_PORT = 4001
// setup xyz
const front = new XYZ({
selfConf: {
name: 'front.ms',
// client.js log
task/io response: null written
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155
task/cpu response: null 9.33262154439441e+155