change reg ex in report to allow minus numbers. Add comments

This commit is contained in:
Carl Glaysher
2012-03-17 13:09:50 +00:00
parent 20e5b7bdac
commit 6434f0058b
2 changed files with 56 additions and 28 deletions

View File

@@ -2,10 +2,29 @@
* User: Carl Glaysher
* Date: 17/03/2012
* Time: 08:46
* Description: Server to Test Connections
* Description: Front end to check spamc client
*/
var spamc = require('./spamc');
var client = new spamc('localhost');
client.learn('My Message','spam',function(res){
console.log(res);
});
var client = new spamc();
client.report('My Message as String',function(result){
console.log(result);
});
/* Example Response
{
responseCode: 0,
responseMessage: 'EX_OK',
isSpam: true,
spamScore: 6.9,
baseSpamScore: 5,
report:[
{
score: '0.0',
name: 'NO_RELAYS',
description: 'Informational',
type: 'message'
}
]
}
*/