0
我已根據以下指示設置persistencejs服務器同步:http://persistencejs.org/plugin/sync與MySQL商店。 Node.js服務器代碼如下。使用persistence.sync.server.js問題
var sys = require('sys');
var persistence = require('./persistence/persistence').persistence;
var persistenceStore = require('./persistence/persistence.store.mysql');
var persistenceSync = require('./persistence/persistence.sync.server');
var Task = persistence.define("Task", {
name: "TEXT",
done: "BOOL"
});
persistenceStore.config(persistence, 'localhost', 3306, 'tasks', 'root', 'zx6h1lmp');
persistenceSync.config(persistence);
var session = persistenceStore.getSession();
session.schemaSync();
var app = require('express').createServer();
app.get('/taskUpdates', function(req, res) {
persistenceSync.pushUpdates(req.conn, req.tx, Task, req.query.since, function(updates){
res.send(updates);
});
});
app.listen(8000);
console.log('Server running at http://localhost:8000/');
裝載/ taskUpdates因爲= 1325375000產生以下錯誤:
Error: Invalid value for argument: callback Value: undefined
at Object.getArgs (C:\tasks\persistence\persistence.js:2150:19)
at Observable.list (C:\tasks\persistence\persistence.store.sql.js:580:24)
at Object.pushUpdates (C:\tasks\persistence\persistence.sync.server.js:82:53)
at C:\tasks\tasks.js:20:19
at callbacks (C:\tasks\node_modules\express\lib\router\index.js:272:11)
at param (C:\tasks\node_modules\express\lib\router\index.js:246:11)
at pass (C:\tasks\node_modules\express\lib\router\index.js:253:5)
at Router._dispatch (C:\tasks\node_modules\express\lib\router\index.js:280:4)
at Object.handle (C:\tasks\node_modules\express\lib\router\index.js:45:10)
at next (C:\tasks\node_modules\express\node_modules\connect\lib\http.js:203:15)
任何瞭解表示讚賞!