pomelo-mysql-data-plugin
v0.0.3
Published
pomelo-mysql-data-plugin
Downloads
4
Readme
pomelo-mysql-data-plugin
forked from pomelo-data-plugin
Config data plugin for Pomelo(a fast,scalable,distributed game server framework for Node.js. http://pomelo.netease.com), it can be used in Pomelo(>=0.7.0).
##Installation
npm install pomelo-mysql-data-plugin
##Usage
var dataPlugin = require('pomelo-mysql-data-plugin');
var mysqlConfig = {
"dialect": "mysql",
"host": "127.0.0.1",
"port": "3306",
"database": "test",
"username": "test",
"password": "test"
};
... ...
app.use(mysqlDataPlugin, {
watcher: {
idx: 'id',
interval: 60000,
dbConfig: mysqlConfig,
tables: ['npc_config', 'task_config']
}
});
... ...
... ...
var npcConf = app.get('dataService').get('npc_config');
... ...
... ...