dckat

카페 리스트 API 호출

1 -var createError = require('http-errors'); 1 +var createError = require("http-errors");
2 -var express = require('express'); 2 +var express = require("express");
3 -var path = require('path'); 3 +var path = require("path");
4 -var cookieParser = require('cookie-parser'); 4 +var cookieParser = require("cookie-parser");
5 -var logger = require('morgan'); 5 +var logger = require("morgan");
6 6
7 -var indexRouter = require('./routes/index'); 7 +var indexRouter = require("./routes/index");
8 -var usersRouter = require('./routes/users'); 8 +var usersRouter = require("./routes/users");
9 9
10 var app = express(); 10 var app = express();
11 11
12 // view engine setup 12 // view engine setup
13 -app.set('views', path.join(__dirname, 'views')); 13 +app.set("views", path.join(__dirname, "views"));
14 -app.set('view engine', 'ejs'); 14 +app.set("view engine", "ejs");
15 15
16 -app.use(logger('dev')); 16 +app.use(logger("dev"));
17 app.use(express.json()); 17 app.use(express.json());
18 app.use(express.urlencoded({ extended: false })); 18 app.use(express.urlencoded({ extended: false }));
19 app.use(cookieParser()); 19 app.use(cookieParser());
20 -app.use(express.static(path.join(__dirname, 'public'))); 20 +app.use(express.static(path.join(__dirname, "public")));
21 21
22 -app.use('/', indexRouter); 22 +app.use("/", indexRouter);
23 -app.use('/users', usersRouter); 23 +app.use("/users", usersRouter);
24 24
25 // catch 404 and forward to error handler 25 // catch 404 and forward to error handler
26 -app.use(function(req, res, next) { 26 +app.use(function (req, res, next) {
27 next(createError(404)); 27 next(createError(404));
28 }); 28 });
29 29
30 // error handler 30 // error handler
31 -app.use(function(err, req, res, next) { 31 +app.use(function (err, req, res, next) {
32 // set locals, only providing error in development 32 // set locals, only providing error in development
33 res.locals.message = err.message; 33 res.locals.message = err.message;
34 - res.locals.error = req.app.get('env') === 'development' ? err : {}; 34 + res.locals.error = req.app.get("env") === "development" ? err : {};
35 35
36 // render the error page 36 // render the error page
37 res.status(err.status || 500); 37 res.status(err.status || 500);
38 - res.render('error'); 38 + res.render("error");
39 }); 39 });
40 40
41 module.exports = app; 41 module.exports = app;
......
...@@ -62,6 +62,17 @@ ...@@ -62,6 +62,17 @@
62 } 62 }
63 } 63 }
64 }, 64 },
65 + "ajv": {
66 + "version": "6.12.6",
67 + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
68 + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
69 + "requires": {
70 + "fast-deep-equal": "^3.1.1",
71 + "fast-json-stable-stringify": "^2.0.0",
72 + "json-schema-traverse": "^0.4.1",
73 + "uri-js": "^4.2.2"
74 + }
75 + },
65 "ansi-align": { 76 "ansi-align": {
66 "version": "3.0.0", 77 "version": "3.0.0",
67 "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", 78 "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz",
...@@ -114,6 +125,14 @@ ...@@ -114,6 +125,14 @@
114 "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", 125 "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
115 "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" 126 "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug=="
116 }, 127 },
128 + "asn1": {
129 + "version": "0.2.4",
130 + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
131 + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
132 + "requires": {
133 + "safer-buffer": "~2.1.0"
134 + }
135 + },
117 "asn1.js": { 136 "asn1.js": {
118 "version": "5.4.1", 137 "version": "5.4.1",
119 "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", 138 "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
...@@ -125,11 +144,31 @@ ...@@ -125,11 +144,31 @@
125 "safer-buffer": "^2.1.0" 144 "safer-buffer": "^2.1.0"
126 } 145 }
127 }, 146 },
147 + "assert-plus": {
148 + "version": "1.0.0",
149 + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
150 + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
151 + },
128 "async": { 152 "async": {
129 "version": "0.9.2", 153 "version": "0.9.2",
130 "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", 154 "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
131 "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" 155 "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
132 }, 156 },
157 + "asynckit": {
158 + "version": "0.4.0",
159 + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
160 + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
161 + },
162 + "aws-sign2": {
163 + "version": "0.7.0",
164 + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
165 + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
166 + },
167 + "aws4": {
168 + "version": "1.11.0",
169 + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
170 + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
171 + },
133 "bagpipe": { 172 "bagpipe": {
134 "version": "0.3.5", 173 "version": "0.3.5",
135 "resolved": "https://registry.npmjs.org/bagpipe/-/bagpipe-0.3.5.tgz", 174 "resolved": "https://registry.npmjs.org/bagpipe/-/bagpipe-0.3.5.tgz",
...@@ -153,6 +192,14 @@ ...@@ -153,6 +192,14 @@
153 "safe-buffer": "5.1.2" 192 "safe-buffer": "5.1.2"
154 } 193 }
155 }, 194 },
195 + "bcrypt-pbkdf": {
196 + "version": "1.0.2",
197 + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
198 + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
199 + "requires": {
200 + "tweetnacl": "^0.14.3"
201 + }
202 + },
156 "bignumber.js": { 203 "bignumber.js": {
157 "version": "9.0.1", 204 "version": "9.0.1",
158 "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", 205 "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
...@@ -306,6 +353,11 @@ ...@@ -306,6 +353,11 @@
306 "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 353 "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
307 "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" 354 "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
308 }, 355 },
356 + "caseless": {
357 + "version": "0.12.0",
358 + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
359 + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
360 + },
309 "chalk": { 361 "chalk": {
310 "version": "2.4.2", 362 "version": "2.4.2",
311 "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 363 "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
...@@ -362,6 +414,14 @@ ...@@ -362,6 +414,14 @@
362 "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 414 "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
363 "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 415 "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
364 }, 416 },
417 + "combined-stream": {
418 + "version": "1.0.8",
419 + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
420 + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
421 + "requires": {
422 + "delayed-stream": "~1.0.0"
423 + }
424 + },
365 "concat-map": { 425 "concat-map": {
366 "version": "0.0.1", 426 "version": "0.0.1",
367 "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 427 "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
...@@ -409,11 +469,24 @@ ...@@ -409,11 +469,24 @@
409 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 469 "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
410 "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 470 "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
411 }, 471 },
472 + "core-util-is": {
473 + "version": "1.0.2",
474 + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
475 + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
476 + },
412 "crypto-random-string": { 477 "crypto-random-string": {
413 "version": "2.0.0", 478 "version": "2.0.0",
414 "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", 479 "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz",
415 "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" 480 "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA=="
416 }, 481 },
482 + "dashdash": {
483 + "version": "1.14.1",
484 + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
485 + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
486 + "requires": {
487 + "assert-plus": "^1.0.0"
488 + }
489 + },
417 "debug": { 490 "debug": {
418 "version": "2.6.9", 491 "version": "2.6.9",
419 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 492 "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
...@@ -440,6 +513,11 @@ ...@@ -440,6 +513,11 @@
440 "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", 513 "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
441 "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" 514 "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ=="
442 }, 515 },
516 + "delayed-stream": {
517 + "version": "1.0.0",
518 + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
519 + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
520 + },
443 "depd": { 521 "depd": {
444 "version": "1.1.2", 522 "version": "1.1.2",
445 "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 523 "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
...@@ -463,6 +541,15 @@ ...@@ -463,6 +541,15 @@
463 "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", 541 "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
464 "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" 542 "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI="
465 }, 543 },
544 + "ecc-jsbn": {
545 + "version": "0.1.2",
546 + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
547 + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
548 + "requires": {
549 + "jsbn": "~0.1.0",
550 + "safer-buffer": "^2.1.0"
551 + }
552 + },
466 "ecdsa-sig-formatter": { 553 "ecdsa-sig-formatter": {
467 "version": "1.0.11", 554 "version": "1.0.11",
468 "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", 555 "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
...@@ -603,6 +690,21 @@ ...@@ -603,6 +690,21 @@
603 "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 690 "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
604 "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 691 "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
605 }, 692 },
693 + "extsprintf": {
694 + "version": "1.3.0",
695 + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
696 + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
697 + },
698 + "fast-deep-equal": {
699 + "version": "3.1.3",
700 + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
701 + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
702 + },
703 + "fast-json-stable-stringify": {
704 + "version": "2.1.0",
705 + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
706 + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
707 + },
606 "fast-text-encoding": { 708 "fast-text-encoding": {
607 "version": "1.0.3", 709 "version": "1.0.3",
608 "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", 710 "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz",
...@@ -638,6 +740,21 @@ ...@@ -638,6 +740,21 @@
638 "unpipe": "~1.0.0" 740 "unpipe": "~1.0.0"
639 } 741 }
640 }, 742 },
743 + "forever-agent": {
744 + "version": "0.6.1",
745 + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
746 + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
747 + },
748 + "form-data": {
749 + "version": "2.3.3",
750 + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
751 + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
752 + "requires": {
753 + "asynckit": "^0.4.0",
754 + "combined-stream": "^1.0.6",
755 + "mime-types": "^2.1.12"
756 + }
757 + },
641 "forwarded": { 758 "forwarded": {
642 "version": "0.1.2", 759 "version": "0.1.2",
643 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 760 "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
...@@ -693,6 +810,14 @@ ...@@ -693,6 +810,14 @@
693 "pump": "^3.0.0" 810 "pump": "^3.0.0"
694 } 811 }
695 }, 812 },
813 + "getpass": {
814 + "version": "0.1.7",
815 + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
816 + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
817 + "requires": {
818 + "assert-plus": "^1.0.0"
819 + }
820 + },
696 "glob-parent": { 821 "glob-parent": {
697 "version": "5.1.2", 822 "version": "5.1.2",
698 "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 823 "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
...@@ -766,6 +891,20 @@ ...@@ -766,6 +891,20 @@
766 "jws": "^4.0.0" 891 "jws": "^4.0.0"
767 } 892 }
768 }, 893 },
894 + "har-schema": {
895 + "version": "2.0.0",
896 + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
897 + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
898 + },
899 + "har-validator": {
900 + "version": "5.1.5",
901 + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
902 + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
903 + "requires": {
904 + "ajv": "^6.12.3",
905 + "har-schema": "^2.0.0"
906 + }
907 + },
769 "has-flag": { 908 "has-flag": {
770 "version": "3.0.0", 909 "version": "3.0.0",
771 "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 910 "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
...@@ -792,6 +931,16 @@ ...@@ -792,6 +931,16 @@
792 "statuses": ">= 1.4.0 < 2" 931 "statuses": ">= 1.4.0 < 2"
793 } 932 }
794 }, 933 },
934 + "http-signature": {
935 + "version": "1.2.0",
936 + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
937 + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
938 + "requires": {
939 + "assert-plus": "^1.0.0",
940 + "jsprim": "^1.2.2",
941 + "sshpk": "^1.7.0"
942 + }
943 + },
795 "https-proxy-agent": { 944 "https-proxy-agent": {
796 "version": "5.0.0", 945 "version": "5.0.0",
797 "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", 946 "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
...@@ -932,6 +1081,11 @@ ...@@ -932,6 +1081,11 @@
932 "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", 1081 "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz",
933 "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" 1082 "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw=="
934 }, 1083 },
1084 + "isstream": {
1085 + "version": "0.1.2",
1086 + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
1087 + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
1088 + },
935 "jake": { 1089 "jake": {
936 "version": "10.8.2", 1090 "version": "10.8.2",
937 "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz", 1091 "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz",
...@@ -943,6 +1097,11 @@ ...@@ -943,6 +1097,11 @@
943 "minimatch": "^3.0.4" 1097 "minimatch": "^3.0.4"
944 } 1098 }
945 }, 1099 },
1100 + "jsbn": {
1101 + "version": "0.1.1",
1102 + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
1103 + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
1104 + },
946 "json-bigint": { 1105 "json-bigint": {
947 "version": "1.0.0", 1106 "version": "1.0.0",
948 "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", 1107 "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
...@@ -956,6 +1115,21 @@ ...@@ -956,6 +1115,21 @@
956 "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", 1115 "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
957 "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" 1116 "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg="
958 }, 1117 },
1118 + "json-schema": {
1119 + "version": "0.2.3",
1120 + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
1121 + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
1122 + },
1123 + "json-schema-traverse": {
1124 + "version": "0.4.1",
1125 + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
1126 + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
1127 + },
1128 + "json-stringify-safe": {
1129 + "version": "5.0.1",
1130 + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
1131 + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
1132 + },
959 "jsonfile": { 1133 "jsonfile": {
960 "version": "4.0.0", 1134 "version": "4.0.0",
961 "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", 1135 "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
...@@ -964,6 +1138,17 @@ ...@@ -964,6 +1138,17 @@
964 "graceful-fs": "^4.1.6" 1138 "graceful-fs": "^4.1.6"
965 } 1139 }
966 }, 1140 },
1141 + "jsprim": {
1142 + "version": "1.4.1",
1143 + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
1144 + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
1145 + "requires": {
1146 + "assert-plus": "1.0.0",
1147 + "extsprintf": "1.3.0",
1148 + "json-schema": "0.2.3",
1149 + "verror": "1.10.0"
1150 + }
1151 + },
967 "jwa": { 1152 "jwa": {
968 "version": "2.0.0", 1153 "version": "2.0.0",
969 "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", 1154 "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz",
...@@ -1173,6 +1358,11 @@ ...@@ -1173,6 +1358,11 @@
1173 "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", 1358 "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz",
1174 "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" 1359 "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ=="
1175 }, 1360 },
1361 + "oauth-sign": {
1362 + "version": "0.9.0",
1363 + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
1364 + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
1365 + },
1176 "object-assign": { 1366 "object-assign": {
1177 "version": "4.1.1", 1367 "version": "4.1.1",
1178 "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1368 "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
...@@ -1232,6 +1422,11 @@ ...@@ -1232,6 +1422,11 @@
1232 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1422 "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
1233 "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 1423 "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
1234 }, 1424 },
1425 + "performance-now": {
1426 + "version": "2.1.0",
1427 + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
1428 + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
1429 + },
1235 "picomatch": { 1430 "picomatch": {
1236 "version": "2.2.3", 1431 "version": "2.2.3",
1237 "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", 1432 "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz",
...@@ -1251,6 +1446,11 @@ ...@@ -1251,6 +1446,11 @@
1251 "ipaddr.js": "1.9.1" 1446 "ipaddr.js": "1.9.1"
1252 } 1447 }
1253 }, 1448 },
1449 + "psl": {
1450 + "version": "1.8.0",
1451 + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
1452 + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
1453 + },
1254 "pstree.remy": { 1454 "pstree.remy": {
1255 "version": "1.1.8", 1455 "version": "1.1.8",
1256 "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", 1456 "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
...@@ -1265,6 +1465,11 @@ ...@@ -1265,6 +1465,11 @@
1265 "once": "^1.3.1" 1465 "once": "^1.3.1"
1266 } 1466 }
1267 }, 1467 },
1468 + "punycode": {
1469 + "version": "2.1.1",
1470 + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
1471 + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
1472 + },
1268 "pupa": { 1473 "pupa": {
1269 "version": "2.1.1", 1474 "version": "2.1.1",
1270 "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", 1475 "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz",
...@@ -1334,6 +1539,33 @@ ...@@ -1334,6 +1539,33 @@
1334 "rc": "^1.2.8" 1539 "rc": "^1.2.8"
1335 } 1540 }
1336 }, 1541 },
1542 + "request": {
1543 + "version": "2.88.2",
1544 + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
1545 + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
1546 + "requires": {
1547 + "aws-sign2": "~0.7.0",
1548 + "aws4": "^1.8.0",
1549 + "caseless": "~0.12.0",
1550 + "combined-stream": "~1.0.6",
1551 + "extend": "~3.0.2",
1552 + "forever-agent": "~0.6.1",
1553 + "form-data": "~2.3.2",
1554 + "har-validator": "~5.1.3",
1555 + "http-signature": "~1.2.0",
1556 + "is-typedarray": "~1.0.0",
1557 + "isstream": "~0.1.2",
1558 + "json-stringify-safe": "~5.0.1",
1559 + "mime-types": "~2.1.19",
1560 + "oauth-sign": "~0.9.0",
1561 + "performance-now": "^2.1.0",
1562 + "qs": "~6.5.2",
1563 + "safe-buffer": "^5.1.2",
1564 + "tough-cookie": "~2.5.0",
1565 + "tunnel-agent": "^0.6.0",
1566 + "uuid": "^3.3.2"
1567 + }
1568 + },
1337 "responselike": { 1569 "responselike": {
1338 "version": "1.0.2", 1570 "version": "1.0.2",
1339 "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", 1571 "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
...@@ -1431,6 +1663,22 @@ ...@@ -1431,6 +1663,22 @@
1431 "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", 1663 "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
1432 "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" 1664 "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
1433 }, 1665 },
1666 + "sshpk": {
1667 + "version": "1.16.1",
1668 + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
1669 + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
1670 + "requires": {
1671 + "asn1": "~0.2.3",
1672 + "assert-plus": "^1.0.0",
1673 + "bcrypt-pbkdf": "^1.0.0",
1674 + "dashdash": "^1.12.0",
1675 + "ecc-jsbn": "~0.1.1",
1676 + "getpass": "^0.1.1",
1677 + "jsbn": "~0.1.0",
1678 + "safer-buffer": "^2.0.2",
1679 + "tweetnacl": "~0.14.0"
1680 + }
1681 + },
1434 "statuses": { 1682 "statuses": {
1435 "version": "1.4.0", 1683 "version": "1.4.0",
1436 "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", 1684 "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
...@@ -1518,6 +1766,28 @@ ...@@ -1518,6 +1766,28 @@
1518 "nopt": "~1.0.10" 1766 "nopt": "~1.0.10"
1519 } 1767 }
1520 }, 1768 },
1769 + "tough-cookie": {
1770 + "version": "2.5.0",
1771 + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
1772 + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
1773 + "requires": {
1774 + "psl": "^1.1.28",
1775 + "punycode": "^2.1.1"
1776 + }
1777 + },
1778 + "tunnel-agent": {
1779 + "version": "0.6.0",
1780 + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
1781 + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
1782 + "requires": {
1783 + "safe-buffer": "^5.0.1"
1784 + }
1785 + },
1786 + "tweetnacl": {
1787 + "version": "0.14.5",
1788 + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
1789 + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
1790 + },
1521 "type-fest": { 1791 "type-fest": {
1522 "version": "0.8.1", 1792 "version": "0.8.1",
1523 "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", 1793 "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
...@@ -1639,6 +1909,14 @@ ...@@ -1639,6 +1909,14 @@
1639 } 1909 }
1640 } 1910 }
1641 }, 1911 },
1912 + "uri-js": {
1913 + "version": "4.4.1",
1914 + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
1915 + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
1916 + "requires": {
1917 + "punycode": "^2.1.0"
1918 + }
1919 + },
1642 "url-parse-lax": { 1920 "url-parse-lax": {
1643 "version": "3.0.0", 1921 "version": "3.0.0",
1644 "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", 1922 "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
...@@ -1652,11 +1930,26 @@ ...@@ -1652,11 +1930,26 @@
1652 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1930 "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
1653 "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 1931 "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
1654 }, 1932 },
1933 + "uuid": {
1934 + "version": "3.4.0",
1935 + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
1936 + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
1937 + },
1655 "vary": { 1938 "vary": {
1656 "version": "1.1.2", 1939 "version": "1.1.2",
1657 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1940 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
1658 "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 1941 "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
1659 }, 1942 },
1943 + "verror": {
1944 + "version": "1.10.0",
1945 + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
1946 + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
1947 + "requires": {
1948 + "assert-plus": "^1.0.0",
1949 + "core-util-is": "1.0.2",
1950 + "extsprintf": "^1.2.0"
1951 + }
1952 + },
1660 "widest-line": { 1953 "widest-line": {
1661 "version": "3.1.0", 1954 "version": "3.1.0",
1662 "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", 1955 "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz",
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
15 "http-errors": "~1.6.3", 15 "http-errors": "~1.6.3",
16 "morgan": "~1.9.1", 16 "morgan": "~1.9.1",
17 "nodemon": "^2.0.7", 17 "nodemon": "^2.0.7",
18 + "request": "^2.88.2",
18 "session-file-store": "^1.5.0" 19 "session-file-store": "^1.5.0"
19 } 20 }
20 } 21 }
......
1 var express = require("express"); 1 var express = require("express");
2 var router = express.Router(); 2 var router = express.Router();
3 +var request = require("request");
4 +
3 var { OAuth2Client } = require("google-auth-library"); 5 var { OAuth2Client } = require("google-auth-library");
6 +var querystring = require("querystring");
7 +
4 var CLIENT_ID = 8 var CLIENT_ID =
5 "94679084723-s5f0686p2porp9mkakrp1p89a48n24nj.apps.googleusercontent.com"; 9 "94679084723-s5f0686p2porp9mkakrp1p89a48n24nj.apps.googleusercontent.com";
6 var client = new OAuth2Client(CLIENT_ID); 10 var client = new OAuth2Client(CLIENT_ID);
...@@ -55,6 +59,37 @@ router.post("/login", (req, res) => { ...@@ -55,6 +59,37 @@ router.post("/login", (req, res) => {
55 console.log(req.body.gender); 59 console.log(req.body.gender);
56 return res.render("login", { user: req.session.user }); 60 return res.render("login", { user: req.session.user });
57 }); 61 });
62 +
63 +router.get("/cafe", (req, res) => {
64 + let code = "CE7";
65 + let encodedStr = querystring.escape(code);
66 +
67 + let kakaoOptions = {
68 + uri: `https://dapi.kakao.com/v2/local/search/category.json?category_group_code=${encodedStr}`,
69 + method: "GET",
70 + headers: {
71 + Authorization: "KakaoAK 2f3999076db5d32db975ab9862a64480",
72 + },
73 + encoding: "utf-8",
74 + };
75 + request(kakaoOptions, callback);
76 +
77 + function callback(error, res, body) {
78 + console.log(body);
79 + let kakaoPlaces = JSON.parse(body);
80 +
81 + for (document of kakaoPlaces.documents) {
82 + console.log(document.id);
83 + console.log(document.place_name);
84 + }
85 + }
86 + return;
87 +});
88 +
89 +router.get("/map", (req, res) => {
90 + res.render("map");
91 +});
92 +
58 module.exports = router; 93 module.exports = router;
59 94
60 function checkAuthenticated(req, res, next) { 95 function checkAuthenticated(req, res, next) {
...@@ -81,7 +116,3 @@ function checkAuthenticated(req, res, next) { ...@@ -81,7 +116,3 @@ function checkAuthenticated(req, res, next) {
81 res.redirect("/index"); 116 res.redirect("/index");
82 }); 117 });
83 } 118 }
84 -
85 -router.get("/map", (req, res) => {
86 - res.render("map");
87 -});
......
1 +{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"__lastAccess":1621216159014}
...\ No newline at end of file ...\ No newline at end of file
...@@ -30,20 +30,15 @@ ...@@ -30,20 +30,15 @@
30 30
31 var locPosition = new kakao.maps.LatLng(lat, lon); 31 var locPosition = new kakao.maps.LatLng(lat, lon);
32 32
33 - displayMarker(locPosition); 33 + displayCurrentPosition(locPosition);
34 }); 34 });
35 } else { 35 } else {
36 var locPosition = new kakao.maps.LatLng(36.2477502, 127.078164); 36 var locPosition = new kakao.maps.LatLng(36.2477502, 127.078164);
37 37
38 - displayMarker(locPosition); 38 + displayCurrentPosition(locPosition);
39 } 39 }
40 40
41 - function displayMarker(locPosition) { 41 + function displayCurrentPosition(locPosition) {
42 - var marker = new daum.maps.Marker({
43 - map: map,
44 - position: locPosition,
45 - });
46 -
47 map.setCenter(locPosition); 42 map.setCenter(locPosition);
48 } 43 }
49 </script> 44 </script>
......