From 130eca4155fd3976041f02e1ecc9baa6ed5f9ebf Mon Sep 17 00:00:00 2001 From: RedDucks Date: Sun, 17 Sep 2017 11:53:38 -0400 Subject: [PATCH] Backend updated API links to v2 --- app.js | 4 ++-- package-lock.json | 61 +++++++++++++++++++++++++++++++++++++++++------ package.json | 1 + 3 files changed, 57 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index e6b26c1..b798079 100644 --- a/app.js +++ b/app.js @@ -341,7 +341,7 @@ function getSuggested(most_played, cb) { for (var i=most_played.length-1;i>=0;i--) { genres.push(most_played[i].genres[Math.floor(Math.random() * most_played[i].genres.length)]); } - request(API_ROOT + '/api/GetSuggested/?genres=' + genres.join('|'), (error, response, body) => { + request(API_ROOT + '/api/v2/GetSuggested/' + genres.join('|'), (error, response, body) => { if (error) return cb(null, {}); body = JSON.parse(body); if (error || response.statusCode !== 200 || !body || body.error) return callback(true); @@ -765,7 +765,7 @@ function getGameData(game_path, is_wud, callback) { post_code = [xml.title_id._Data.slice(0, 8), '-', xml.title_id._Data.slice(8)].join(''); } - request(API_ROOT + '/api/GetGame/?' + post_type + '=' + post_code, (error, response, body) => { + request(API_ROOT + '/api/v2/GetGame/' + post_type + '/' + post_code, (error, response, body) => { body = JSON.parse(body); if (!body || body.error) return callback(true); return callback(null, body) diff --git a/package-lock.json b/package-lock.json index 23ff482..9aea18f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cemui", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1464,8 +1464,7 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.4", @@ -2078,6 +2077,51 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "mysql": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.14.1.tgz", + "integrity": "sha512-ZPXqQeYH7L1QPDyC77Rcp32cNCQnNjz8Y4BbF17tOjm5yhSfjFa3xS4PvuxWJtEEmwVc4ccI7sSntj4eyYRq0A==", + "requires": { + "bignumber.js": "4.0.2", + "readable-stream": "2.3.3", + "safe-buffer": "5.1.1", + "sqlstring": "2.2.0" + }, + "dependencies": { + "bignumber.js": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-4.0.2.tgz", + "integrity": "sha1-LR3DfuWWiGfs6pC22k0W5oYI0h0=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, "mz": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.6.0.tgz", @@ -2454,8 +2498,7 @@ "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=", - "dev": true + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" }, "progress-stream": { "version": "1.2.0", @@ -2898,6 +2941,11 @@ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, + "sqlstring": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.2.0.tgz", + "integrity": "sha1-wxNcTqirzX5+50GklmqJHYak8ZE=" + }, "sshpk": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", @@ -3295,8 +3343,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=" }, "uuid": { "version": "3.1.0", diff --git a/package.json b/package.json index c7ab3a5..ec4f4f4 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "ini": "^1.3.4", "jimp": "^0.2.28", "lowdb": "^0.17.2", + "mysql": "^2.14.1", "pixl-xml": "^1.0.13", "png-to-ico": "^1.0.3", "request": "^2.81.0",