Commit 58b973bb authored by Lorex's avatar Lorex

feat: 新增資料庫連線

parent 67e5f050
......@@ -351,12 +351,22 @@
"concat-map": "0.0.1"
}
},
"bson": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz",
"integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg=="
},
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
"buffer-shims": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz",
"integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E="
},
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
......@@ -608,8 +618,7 @@
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"crc": {
"version": "3.4.4",
......@@ -801,6 +810,11 @@
"has-binary2": "~1.0.2"
}
},
"es6-promise": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz",
"integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
......@@ -1629,6 +1643,51 @@
}
}
},
"mongodb": {
"version": "2.2.25",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.25.tgz",
"integrity": "sha1-07JdrQDtor38vJliELoIKsaGprY=",
"requires": {
"es6-promise": "3.2.1",
"mongodb-core": "2.1.9",
"readable-stream": "2.1.5"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
},
"readable-stream": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz",
"integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=",
"requires": {
"buffer-shims": "^1.0.0",
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "~1.0.0",
"process-nextick-args": "~1.0.6",
"string_decoder": "~0.10.x",
"util-deprecate": "~1.0.1"
}
}
}
},
"mongodb-core": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.9.tgz",
"integrity": "sha1-hapx7k+3FhluBreHVXvxOfgB2vU=",
"requires": {
"bson": "~1.0.4",
"require_optional": "~1.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
......@@ -2035,6 +2094,27 @@
"resolve-from": "^1.0.0"
}
},
"require_optional": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz",
"integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==",
"requires": {
"resolve-from": "^2.0.0",
"semver": "^5.1.0"
},
"dependencies": {
"resolve-from": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz",
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
},
"semver": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
}
}
},
"resolve-from": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz",
......@@ -2415,6 +2495,42 @@
}
}
},
"sails-mongo": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/sails-mongo/-/sails-mongo-1.0.1.tgz",
"integrity": "sha512-VFssxPhi0p7PcD3teJmqmwSoaN/8jMf2y6uUefz0dca2CJ/3js2OR8nzxtdmSpm2s0Uq0kytuG38A1+CZbXRkw==",
"requires": {
"@sailshq/lodash": "^3.10.2",
"async": "2.0.1",
"flaverr": "1.1.1",
"machine": "^15.0.0",
"mongodb": "2.2.25",
"qs": "6.4.0"
},
"dependencies": {
"async": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/async/-/async-2.0.1.tgz",
"integrity": "sha1-twnMAoCpw28J9FNr6CPIOKkEniU=",
"requires": {
"lodash": "^4.8.0"
}
},
"flaverr": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/flaverr/-/flaverr-1.1.1.tgz",
"integrity": "sha1-x9XWD5HB/S8DOwZr7NovSHNsFv8=",
"requires": {
"@sailshq/lodash": "^3.10.2"
}
},
"qs": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz",
"integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM="
}
}
},
"sails-stringfile": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/sails-stringfile/-/sails-stringfile-0.3.3.tgz",
......@@ -2881,8 +2997,7 @@
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"utile": {
"version": "0.2.1",
......
......@@ -5,10 +5,11 @@
"description": "exam system single-sign-on api",
"keywords": [],
"dependencies": {
"@sailshq/lodash": "^3.10.3",
"sails": "^1.1.0",
"sails-hook-orm": "^2.1.1",
"sails-hook-sockets": "^1.5.5",
"@sailshq/lodash": "^3.10.3"
"sails-mongo": "^1.0.1"
},
"devDependencies": {
"@sailshq/eslint": "^4.19.3"
......
......@@ -48,8 +48,8 @@ module.exports.datastores = {
* (See https://sailsjs.com/config/datastores for help.) *
* *
***************************************************************************/
// adapter: 'sails-mysql',
// url: 'mysql://user:password@host:port/database',
adapter: 'sails-mongo',
url: 'mongodb://user:exam-sso@192.168.2.155:27017/exam-sso',
},
......
......@@ -35,7 +35,7 @@ module.exports.models = {
* *
***************************************************************************/
// schema: true,
schema: true,
/***************************************************************************
......@@ -53,7 +53,7 @@ module.exports.models = {
* *
***************************************************************************/
// migrate: 'alter',
migrate: 'alter',
/***************************************************************************
......@@ -71,7 +71,7 @@ module.exports.models = {
attributes: {
createdAt: { type: 'number', autoCreatedAt: true, },
updatedAt: { type: 'number', autoUpdatedAt: true, },
id: { type: 'number', autoIncrement: true, },
id: { type: 'string', columnName: '_id' },
//--------------------------------------------------------------------------
// /\ Using MongoDB?
// || Replace `id` above with this instead:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment