yi / node-ticket-manager Goto Github PK
View Code? Open in Web Editor NEWa simple ticket system contians a centeral ticket dispatcher and distributed workers. This system is written in NodeJS, runing on MongoDB
License: MIT License
a simple ticket system contians a centeral ticket dispatcher and distributed workers. This system is written in NodeJS, runing on MongoDB
License: MIT License
This is my code:
var util = require('util'),
http = require('http'),
httpProxy = require('http-proxy');
httpProxy.createProxyServer({target:'http://localhost:9000'}).listen(8000);
var TicketManager = require("ticketman").TicketManager;
var TicketWorker = require("ticketman").TicketWorker;
var ticketWorker = null;
var mongoose = require('mongoose');
var express = require('express');
http.createServer(function (req, res, body) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2));
res.end();
}).listen(9000);
var ticketManager = new TicketManager("test ticket_manager", "http://localhost:3456");
// = new TicketWorker({id:1001, name:"test ticket_manager", host:"http://localhost:9000", category:"worker", consumerSecret: "bigSmalls"});
var category, content, title;
content = {
detailed: "content of ticket",
mixed: ["data"]
};
title = "test ticket " + (Date.now());
category = "sample";
ticketManager.issue(title, category, content, function (err, ticket) {
setTimeout(function(){
console.log(ticket);
console.log(err);
}, 500);
});
}).call(this);
But I am getting this error!
[Error: Fail to create ticket:test ticket 1449613199454#sample, due to MongoErro r: driver is incompatible with this server version]
我们团队需要搞一个客服系统,追踪每个客户相关的“事件”。
希望能用Nodejs实现,但是搜遍了全网,没找到合适的项目。
国外的很多网站客服好像都叫做“request a ticket” 不知道这个node-ticket-manager是针对这个场景设计的吗?
hello it seems what I need to use for a client of mine since programming it would take too much time from me. I downloaded the latest version unzip it and installed all package but could not get it working it releases to many errors
`Failed to load c++ bson extension, using pure JS version
[express::main] pathToView:/Users/amirmahmoodi/Downloads/node-ticket-manager-0.2.5/views
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
ticketman:server Ticketman app started on port 3456 +90ms
events.js:292
throw er; // Unhandled 'error' event
^
Error: failed to connect to [localhost:27017]`
i am able to run the ticket manager locally on my machine using npm start .
However i tried to install it on openshift.com and it is not starting .. On searching internet i found that the start commands should be part of package.json and npm start is not part of start tag in package.json .
The error on server states :
DEBUG: Running node-supervisor with
DEBUG: program 'lib/index'
DEBUG: --watch '/var/lib/openshift/549c15254382ec58f0000070/app-root/data/.nodewatch'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node|js|coffee'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node lib/index'
DEBUG: Watching directory '/var/lib/openshift/549c15254382ec58f0000070/app-root/data/.nodewatch' for changes.
DEBUG: Program node lib/index exited with code 0
DEBUG: Starting child process with 'node lib/index'
DEBUG: Program node lib/index exited with code 0
DEBUG: Starting child process with 'node lib/index'
These last commands are reperting and server is not starting .
DO i need to make few changes before i can run it easily on some server for free . In case you have some server instances where u ran it without change for free can u guide me .
I am new to using either mongo and/or node. But I have setup a few other packages in the past.
Currently I am running into an issue where it looks like npm start is not allowing the connection to be made to localhost:27017.
Has anyone else experienced this as an issue? I have tired running it from both an Ubuntu 16 system and a windows 10 system. I get the same error on both systems.
`>npm start
[email protected] start C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5
nodemon lib/server.js
[nodemon] 1.11.0
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node lib/server.js
Failed to load c++ bson extension, using pure JS version
Failed to load c++ bson extension, using pure JS version
[express::main] pathToView:C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\views
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
events.js:141
throw er; // Unhandled 'error' event
^
Error: failed to connect to [localhost:27017]
at null. (C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:553:25)
at emitThree (events.js:97:13)
at emit (events.js:175:7)
at null. (C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:140:15)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket. (C:\Users\gus\Documents\Node\ticketman\node-ticket-manager-0.2.5\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection.js:512:10)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1269:8)
[nodemon] app crashed - waiting for file changes before starting...
^CTerminate batch job (Y/N)? y`
Nevermind the previous version of this issue, I just noticed the app uses basic auth and found the credentials in config.js. Do you have any suggestions as to how one might start the work of giving it more robust auth?
Using node 6.5, npm 3.10.3. windows 7 64 bit:
a) Downloaded the .25 code from Git Hub
b) cd in directory, npm install
c) attempting npm start, and received this error set
Failed to load c++ bson extension, using pure JS version
[express::main] pathToView:C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\views
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
events.js:160
throw er; // Unhandled 'error' event
^
Error: failed to connect to [localhost:27017]
at . (C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\node_modules\mongodb\lib\mongodb\connection\server.js:553:25)
at emitThree (events.js:116:13)
at emit (events.js:194:7)
at . (C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:14
at emitTwo (events.js:106:13)
at emit (events.js:191:7)
at Socket. (C:\pdykes\data\nodejs\node-ticket-manager-0.2.5\node_modules\mongodb\lib\mongodb\connection\connection.js:5
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1272:8)
Solution welcome...
hi
when i do start
& go to
http://localhost:3456/ when shoudl i use as default username and password ? in which file is this configuration done ?
regards
mac
当每次 worker 来请求任务的时候,更新 worker 的 updated_at 时间戳,从而可以在 /workers 页面中看到哪个 worker 近期没有来工作
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.