parent
709099dd21
commit
d7955e5d0f
7 changed files with 74 additions and 35 deletions
@ -1,8 +0,0 @@ |
||||
{ |
||||
"host" : "localhost", |
||||
"user" : "root", |
||||
"port" : 8654, |
||||
"password" : "ert456", |
||||
"database" : "safechat", |
||||
"max_allowed_packet": 1000000000 |
||||
} |
@ -1,13 +1,11 @@ |
||||
module.exports = function() { |
||||
var mysql = require('mysql'); |
||||
var fs = require('fs'); |
||||
var config = require(__dirname+'/config.json'); |
||||
config.multipleStatements = true; |
||||
var pool = mysql.createPool(config); |
||||
|
||||
pool.query(fs.readFileSync(__dirname+'/schema.sql').toString()); |
||||
if (config.max_allowed_packet) |
||||
pool.query("set global max_allowed_packet=?", [config.max_allowed_packet]); |
||||
|
||||
return pool; |
||||
module.exports = function(config) { |
||||
var mysql = require('mysql'); |
||||
var fs = require('fs'); |
||||
config.multipleStatements = true; |
||||
var pool = mysql.createPool(config); |
||||
console.log(__dirname+'/schema.sql') |
||||
pool.query(fs.readFileSync(__dirname+'/schema.sql').toString()); |
||||
if (config.max_allowed_packet) |
||||
pool.query("set global max_allowed_packet=?", [config.max_allowed_packet]); |
||||
return pool; |
||||
}; |
||||
|
@ -0,0 +1,10 @@ |
||||
{ |
||||
"mysql": { |
||||
"host" : "localhost", |
||||
"user" : "root", |
||||
"port" : 8654, |
||||
"password" : "ert456", |
||||
"database" : "safechat", |
||||
"max_allowed_packet": 1000000000 |
||||
} |
||||
} |
@ -1,12 +1,29 @@ |
||||
{ |
||||
"name": "@PACKAGE_NAME@", |
||||
"version": "@PACKAGE_VERSION@", |
||||
"private": true, |
||||
"dependencies": { |
||||
"express": "2.5.8", |
||||
"stylus": ">= 0.0.1", |
||||
"ejs": ">= 0.0.1", |
||||
"mysql": "~2.10.2", |
||||
"socket.io": "~1.4.4" |
||||
} |
||||
"name": "@PACKAGE_NAME@", |
||||
"version": "@PACKAGE_VERSION@", |
||||
"private": true, |
||||
"dependencies": { |
||||
"express": "2.5.8", |
||||
"stylus": ">= 0.0.1", |
||||
"ejs": ">= 0.0.1", |
||||
"mysql": "~2.10.2", |
||||
"socket.io": "~1.4.4" |
||||
}, |
||||
"description": "@DESCRIPTION@", |
||||
"main": "@PACKAGE_NAME@.js", |
||||
"devDependencies": {}, |
||||
"scripts": { |
||||
"test": "echo \"Error: no test specified\" && exit 1" |
||||
}, |
||||
"author": "@AUTHOR@", |
||||
"license": "@LICENSE@", |
||||
"path": { |
||||
"prefix": "@PREFIX@", |
||||
"sysconf": "@SYSCONFDIR@", |
||||
"pkgdata": "@PKGDATADIR@", |
||||
"localstate": "@LOCALSTATEDIR@", |
||||
"log": "@LOCALSTATEDIR@/log/@PACKAGE_NAME@.log", |
||||
"config": "@SYSCONFDIR@/@PACKAGE_NAME@.json", |
||||
"nodejs": "@PKGDATADIR@/nodejs" |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue