Showing
4 changed files
with
1 additions
and
123 deletions
... | @@ -40,35 +40,8 @@ services: | ... | @@ -40,35 +40,8 @@ services: |
40 | command: bash -c "npm install && node app.js" | 40 | command: bash -c "npm install && node app.js" |
41 | environment: | 41 | environment: |
42 | - NODE_ENV=production | 42 | - NODE_ENV=production |
43 | - links: | ||
44 | - - db | ||
45 | - depends_on: | ||
46 | - - db | ||
47 | restart: on-failure | 43 | restart: on-failure |
48 | 44 | ||
49 | - db: | ||
50 | - image: mariadb:10.2 | ||
51 | - container_name: mariadb10.2 | ||
52 | - ports: | ||
53 | - - "33066:3306" | ||
54 | - networks: | ||
55 | - mynet: | ||
56 | - ipv4_address: 172.28.0.4 | ||
57 | - volumes: | ||
58 | - - mariadb:/var/lib/mysql | ||
59 | - - ./config:/config | ||
60 | - environment: | ||
61 | - MYSQL_ROOT_PASSWORD_FILE: ./config/db_password.secret | ||
62 | - MYSQL_DATABASE: maple | ||
63 | - MYSQL_USER: maple | ||
64 | - MYSQL_PASSWORD_FILE: ./config/db_password.secret | ||
65 | - TZ: Asia/Seoul | ||
66 | - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE | ||
67 | - restart: on-failure | ||
68 | - | ||
69 | -volumes: | ||
70 | - mariadb: | ||
71 | - | ||
72 | networks: | 45 | networks: |
73 | mynet: | 46 | mynet: |
74 | ipam: | 47 | ipam: | ... | ... |
1 | var express = require('express'); | 1 | var express = require('express'); |
2 | var app = express(); | 2 | var app = express(); |
3 | var bodyParser = require('body-parser'); | 3 | var bodyParser = require('body-parser'); |
4 | -var mysql = require('mysql'); | ||
5 | -var fs = require('fs'); | ||
6 | 4 | ||
7 | app.use(bodyParser.urlencoded({ extended: false })); | 5 | app.use(bodyParser.urlencoded({ extended: false })); |
8 | app.use(bodyParser.json()); | 6 | app.use(bodyParser.json()); |
9 | 7 | ||
10 | -var db; | ||
11 | - | ||
12 | -fs.readFile('./config/db_password.secret', function(err, data) { | ||
13 | - db = mysql.createConnection({ | ||
14 | - host: "172.28.0.4", | ||
15 | - port: 3306, | ||
16 | - user: "root", | ||
17 | - password: data, | ||
18 | - database: "mysql" | ||
19 | - }); | ||
20 | - | ||
21 | - db.connect(); | ||
22 | -}); | ||
23 | - | ||
24 | -app.get('/query', function (req, res) { | ||
25 | - db.query("SHOW DATABASES", | ||
26 | - function(err, results, fields) { | ||
27 | - if (err) throw err; | ||
28 | - var string = JSON.stringify(results); | ||
29 | - res.send(string); | ||
30 | - } | ||
31 | - ); | ||
32 | -}); | ||
33 | - | ||
34 | var server = app.listen(80); | 8 | var server = app.listen(80); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -18,11 +18,6 @@ | ... | @@ -18,11 +18,6 @@ |
18 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", | 18 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", |
19 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" | 19 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" |
20 | }, | 20 | }, |
21 | - "bignumber.js": { | ||
22 | - "version": "9.0.0", | ||
23 | - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", | ||
24 | - "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" | ||
25 | - }, | ||
26 | "body-parser": { | 21 | "body-parser": { |
27 | "version": "1.19.0", | 22 | "version": "1.19.0", |
28 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", | 23 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", |
... | @@ -68,11 +63,6 @@ | ... | @@ -68,11 +63,6 @@ |
68 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", | 63 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", |
69 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" | 64 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" |
70 | }, | 65 | }, |
71 | - "core-util-is": { | ||
72 | - "version": "1.0.2", | ||
73 | - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", | ||
74 | - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" | ||
75 | - }, | ||
76 | "debug": { | 66 | "debug": { |
77 | "version": "2.6.9", | 67 | "version": "2.6.9", |
78 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", | 68 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", |
... | @@ -204,21 +194,11 @@ | ... | @@ -204,21 +194,11 @@ |
204 | "safer-buffer": ">= 2.1.2 < 3" | 194 | "safer-buffer": ">= 2.1.2 < 3" |
205 | } | 195 | } |
206 | }, | 196 | }, |
207 | - "inherits": { | ||
208 | - "version": "2.0.4", | ||
209 | - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", | ||
210 | - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" | ||
211 | - }, | ||
212 | "ipaddr.js": { | 197 | "ipaddr.js": { |
213 | "version": "1.9.1", | 198 | "version": "1.9.1", |
214 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", | 199 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", |
215 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" | 200 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" |
216 | }, | 201 | }, |
217 | - "isarray": { | ||
218 | - "version": "1.0.0", | ||
219 | - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", | ||
220 | - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" | ||
221 | - }, | ||
222 | "media-typer": { | 202 | "media-typer": { |
223 | "version": "0.3.0", | 203 | "version": "0.3.0", |
224 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", | 204 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", |
... | @@ -257,17 +237,6 @@ | ... | @@ -257,17 +237,6 @@ |
257 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", | 237 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", |
258 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" | 238 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" |
259 | }, | 239 | }, |
260 | - "mysql": { | ||
261 | - "version": "2.18.1", | ||
262 | - "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", | ||
263 | - "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", | ||
264 | - "requires": { | ||
265 | - "bignumber.js": "9.0.0", | ||
266 | - "readable-stream": "2.3.7", | ||
267 | - "safe-buffer": "5.1.2", | ||
268 | - "sqlstring": "2.3.1" | ||
269 | - } | ||
270 | - }, | ||
271 | "negotiator": { | 240 | "negotiator": { |
272 | "version": "0.6.2", | 241 | "version": "0.6.2", |
273 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", | 242 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", |
... | @@ -291,11 +260,6 @@ | ... | @@ -291,11 +260,6 @@ |
291 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", | 260 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", |
292 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" | 261 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" |
293 | }, | 262 | }, |
294 | - "process-nextick-args": { | ||
295 | - "version": "2.0.1", | ||
296 | - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", | ||
297 | - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" | ||
298 | - }, | ||
299 | "proxy-addr": { | 263 | "proxy-addr": { |
300 | "version": "2.0.6", | 264 | "version": "2.0.6", |
301 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", | 265 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", |
... | @@ -326,20 +290,6 @@ | ... | @@ -326,20 +290,6 @@ |
326 | "unpipe": "1.0.0" | 290 | "unpipe": "1.0.0" |
327 | } | 291 | } |
328 | }, | 292 | }, |
329 | - "readable-stream": { | ||
330 | - "version": "2.3.7", | ||
331 | - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", | ||
332 | - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", | ||
333 | - "requires": { | ||
334 | - "core-util-is": "~1.0.0", | ||
335 | - "inherits": "~2.0.3", | ||
336 | - "isarray": "~1.0.0", | ||
337 | - "process-nextick-args": "~2.0.0", | ||
338 | - "safe-buffer": "~5.1.1", | ||
339 | - "string_decoder": "~1.1.1", | ||
340 | - "util-deprecate": "~1.0.1" | ||
341 | - } | ||
342 | - }, | ||
343 | "safe-buffer": { | 293 | "safe-buffer": { |
344 | "version": "5.1.2", | 294 | "version": "5.1.2", |
345 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", | 295 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", |
... | @@ -393,24 +343,11 @@ | ... | @@ -393,24 +343,11 @@ |
393 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", | 343 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", |
394 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" | 344 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" |
395 | }, | 345 | }, |
396 | - "sqlstring": { | ||
397 | - "version": "2.3.1", | ||
398 | - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", | ||
399 | - "integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=" | ||
400 | - }, | ||
401 | "statuses": { | 346 | "statuses": { |
402 | "version": "1.5.0", | 347 | "version": "1.5.0", |
403 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", | 348 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", |
404 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" | 349 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" |
405 | }, | 350 | }, |
406 | - "string_decoder": { | ||
407 | - "version": "1.1.1", | ||
408 | - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", | ||
409 | - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", | ||
410 | - "requires": { | ||
411 | - "safe-buffer": "~5.1.0" | ||
412 | - } | ||
413 | - }, | ||
414 | "toidentifier": { | 351 | "toidentifier": { |
415 | "version": "1.0.0", | 352 | "version": "1.0.0", |
416 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", | 353 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", |
... | @@ -430,11 +367,6 @@ | ... | @@ -430,11 +367,6 @@ |
430 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", | 367 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", |
431 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" | 368 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" |
432 | }, | 369 | }, |
433 | - "util-deprecate": { | ||
434 | - "version": "1.0.2", | ||
435 | - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", | ||
436 | - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" | ||
437 | - }, | ||
438 | "utils-merge": { | 370 | "utils-merge": { |
439 | "version": "1.0.1", | 371 | "version": "1.0.1", |
440 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", | 372 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", | ... | ... |
-
Please register or login to post a comment