강수인

채팅 서비스 라인으로 변경(처음부터 다시 코딩..)

1 -var express = require('express');
2 -var path = require('path');
3 -var favicon = require('serve-favicon');
4 -var logger = require('morgan');
5 -var cookieParser = require('cookie-parser');
6 -var bodyParser = require('body-parser');
7 -
8 -var message = require('./routes/message');
9 -var keyboard = require('./routes/keyboard');
10 -var app = express();
11 -
12 -// view engine setup
13 -app.set('views', path.join(__dirname, 'views'));
14 -app.set('view engine', 'ejs');
15 -
16 -// uncomment after placing your favicon in /public
17 -//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
18 -app.use(logger('dev'));
19 -app.use(bodyParser.json());
20 -app.use(bodyParser.urlencoded({ extended: false }));
21 -app.use(cookieParser());
22 -app.use(express.static(path.join(__dirname, 'public')));
23 -
24 -app.use('/keyboard',keyboard);
25 -app.use('/message',message);
26 -
27 -// catch 404 and forward to error handler
28 -app.use(function(req, res, next) {
29 - var err = new Error('Not Found');
30 - err.status = 404;
31 - next(err);
32 -});
33 -
34 -// error handler
35 -app.use(function(err, req, res, next) {
36 - // set locals, only providing error in development
37 - res.locals.message = err.message;
38 - res.locals.error = req.app.get('env') === 'development' ? err : {};
39 -
40 - // render the error page
41 - res.status(err.status || 500);
42 - res.render('error');
43 -});
44 -
45 -module.exports = app;
46 -
1 -#!/usr/bin/env node
2 -
3 -/**
4 - * Module dependencies.
5 - */
6 -
7 -var app = require('../app');
8 -var debug = require('debug')('project:server');
9 -var http = require('http');
10 -
11 -/**
12 - * Get port from environment and store in Express.
13 - */
14 -
15 -var port = normalizePort(process.env.PORT || '3000');
16 -app.set('port', port);
17 -
18 -/**
19 - * Create HTTP server.
20 - */
21 -
22 -var server = http.createServer(app);
23 -
24 -/**
25 - * Listen on provided port, on all network interfaces.
26 - */
27 -
28 -server.listen(port);
29 -server.on('error', onError);
30 -server.on('listening', onListening);
31 -
32 -/**
33 - * Normalize a port into a number, string, or false.
34 - */
35 -
36 -function normalizePort(val) {
37 - var port = parseInt(val, 10);
38 -
39 - if (isNaN(port)) {
40 - // named pipe
41 - return val;
42 - }
43 -
44 - if (port >= 0) {
45 - // port number
46 - return port;
47 - }
48 -
49 - return false;
50 -}
51 -
52 -/**
53 - * Event listener for HTTP server "error" event.
54 - */
55 -
56 -function onError(error) {
57 - if (error.syscall !== 'listen') {
58 - throw error;
59 - }
60 -
61 - var bind = typeof port === 'string'
62 - ? 'Pipe ' + port
63 - : 'Port ' + port;
64 -
65 - // handle specific listen errors with friendly messages
66 - switch (error.code) {
67 - case 'EACCES':
68 - console.error(bind + ' requires elevated privileges');
69 - process.exit(1);
70 - break;
71 - case 'EADDRINUSE':
72 - console.error(bind + ' is already in use');
73 - process.exit(1);
74 - break;
75 - default:
76 - throw error;
77 - }
78 -}
79 -
80 -/**
81 - * Event listener for HTTP server "listening" event.
82 - */
83 -
84 -function onListening() {
85 - var addr = server.address();
86 - var bind = typeof addr === 'string'
87 - ? 'pipe ' + addr
88 - : 'port ' + addr.port;
89 - debug('Listening on ' + bind);
90 -}
1 -2018/11/26
2 -mother project : KakaoBot
3 -추가기능 : 파파고 api를 이용한 카카오톡에서 전송한 사진 속 글자 인식 및 번역
...\ No newline at end of file ...\ No newline at end of file
1 -{
2 - "name": "project",
3 - "version": "0.0.0",
4 - "lockfileVersion": 1,
5 - "requires": true,
6 - "dependencies": {
7 - "accepts": {
8 - "version": "1.3.5",
9 - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
10 - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
11 - "requires": {
12 - "mime-types": "~2.1.18",
13 - "negotiator": "0.6.1"
14 - }
15 - },
16 - "ajv": {
17 - "version": "5.5.2",
18 - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
19 - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
20 - "requires": {
21 - "co": "^4.6.0",
22 - "fast-deep-equal": "^1.0.0",
23 - "fast-json-stable-stringify": "^2.0.0",
24 - "json-schema-traverse": "^0.3.0"
25 - }
26 - },
27 - "array-flatten": {
28 - "version": "1.1.1",
29 - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
30 - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
31 - },
32 - "asn1": {
33 - "version": "0.2.4",
34 - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
35 - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
36 - "requires": {
37 - "safer-buffer": "~2.1.0"
38 - }
39 - },
40 - "assert-plus": {
41 - "version": "1.0.0",
42 - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
43 - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
44 - },
45 - "asynckit": {
46 - "version": "0.4.0",
47 - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
48 - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
49 - },
50 - "aws-sign2": {
51 - "version": "0.7.0",
52 - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
53 - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
54 - },
55 - "aws4": {
56 - "version": "1.8.0",
57 - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
58 - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
59 - },
60 - "basic-auth": {
61 - "version": "2.0.0",
62 - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz",
63 - "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=",
64 - "requires": {
65 - "safe-buffer": "5.1.1"
66 - }
67 - },
68 - "bcrypt-pbkdf": {
69 - "version": "1.0.2",
70 - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
71 - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
72 - "optional": true,
73 - "requires": {
74 - "tweetnacl": "^0.14.3"
75 - }
76 - },
77 - "body-parser": {
78 - "version": "1.18.3",
79 - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz",
80 - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
81 - "requires": {
82 - "bytes": "3.0.0",
83 - "content-type": "~1.0.4",
84 - "debug": "2.6.9",
85 - "depd": "~1.1.2",
86 - "http-errors": "~1.6.3",
87 - "iconv-lite": "0.4.23",
88 - "on-finished": "~2.3.0",
89 - "qs": "6.5.2",
90 - "raw-body": "2.3.3",
91 - "type-is": "~1.6.16"
92 - },
93 - "dependencies": {
94 - "depd": {
95 - "version": "1.1.2",
96 - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
97 - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
98 - },
99 - "iconv-lite": {
100 - "version": "0.4.23",
101 - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
102 - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
103 - "requires": {
104 - "safer-buffer": ">= 2.1.2 < 3"
105 - }
106 - },
107 - "raw-body": {
108 - "version": "2.3.3",
109 - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz",
110 - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==",
111 - "requires": {
112 - "bytes": "3.0.0",
113 - "http-errors": "1.6.3",
114 - "iconv-lite": "0.4.23",
115 - "unpipe": "1.0.0"
116 - }
117 - }
118 - }
119 - },
120 - "bytes": {
121 - "version": "3.0.0",
122 - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
123 - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
124 - },
125 - "caseless": {
126 - "version": "0.12.0",
127 - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
128 - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
129 - },
130 - "co": {
131 - "version": "4.6.0",
132 - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
133 - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
134 - },
135 - "combined-stream": {
136 - "version": "1.0.6",
137 - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
138 - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
139 - "requires": {
140 - "delayed-stream": "~1.0.0"
141 - }
142 - },
143 - "content-disposition": {
144 - "version": "0.5.2",
145 - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
146 - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
147 - },
148 - "content-type": {
149 - "version": "1.0.4",
150 - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
151 - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
152 - },
153 - "cookie": {
154 - "version": "0.3.1",
155 - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
156 - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
157 - },
158 - "cookie-parser": {
159 - "version": "1.4.3",
160 - "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz",
161 - "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=",
162 - "requires": {
163 - "cookie": "0.3.1",
164 - "cookie-signature": "1.0.6"
165 - }
166 - },
167 - "cookie-signature": {
168 - "version": "1.0.6",
169 - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
170 - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
171 - },
172 - "core-util-is": {
173 - "version": "1.0.2",
174 - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
175 - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
176 - },
177 - "dashdash": {
178 - "version": "1.14.1",
179 - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
180 - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
181 - "requires": {
182 - "assert-plus": "^1.0.0"
183 - }
184 - },
185 - "debug": {
186 - "version": "2.6.9",
187 - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
188 - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
189 - "requires": {
190 - "ms": "2.0.0"
191 - }
192 - },
193 - "delayed-stream": {
194 - "version": "1.0.0",
195 - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
196 - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
197 - },
198 - "depd": {
199 - "version": "1.1.1",
200 - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
201 - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k="
202 - },
203 - "destroy": {
204 - "version": "1.0.4",
205 - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
206 - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
207 - },
208 - "ecc-jsbn": {
209 - "version": "0.1.2",
210 - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
211 - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
212 - "optional": true,
213 - "requires": {
214 - "jsbn": "~0.1.0",
215 - "safer-buffer": "^2.1.0"
216 - }
217 - },
218 - "ee-first": {
219 - "version": "1.1.1",
220 - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
221 - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
222 - },
223 - "ejs": {
224 - "version": "2.5.7",
225 - "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.7.tgz",
226 - "integrity": "sha1-zIcsFoiArjxxiXYv1f/ACJbJUYo="
227 - },
228 - "encodeurl": {
229 - "version": "1.0.2",
230 - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
231 - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
232 - },
233 - "escape-html": {
234 - "version": "1.0.3",
235 - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
236 - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
237 - },
238 - "etag": {
239 - "version": "1.8.1",
240 - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
241 - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
242 - },
243 - "express": {
244 - "version": "4.16.3",
245 - "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
246 - "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
247 - "requires": {
248 - "accepts": "~1.3.5",
249 - "array-flatten": "1.1.1",
250 - "body-parser": "1.18.2",
251 - "content-disposition": "0.5.2",
252 - "content-type": "~1.0.4",
253 - "cookie": "0.3.1",
254 - "cookie-signature": "1.0.6",
255 - "debug": "2.6.9",
256 - "depd": "~1.1.2",
257 - "encodeurl": "~1.0.2",
258 - "escape-html": "~1.0.3",
259 - "etag": "~1.8.1",
260 - "finalhandler": "1.1.1",
261 - "fresh": "0.5.2",
262 - "merge-descriptors": "1.0.1",
263 - "methods": "~1.1.2",
264 - "on-finished": "~2.3.0",
265 - "parseurl": "~1.3.2",
266 - "path-to-regexp": "0.1.7",
267 - "proxy-addr": "~2.0.3",
268 - "qs": "6.5.1",
269 - "range-parser": "~1.2.0",
270 - "safe-buffer": "5.1.1",
271 - "send": "0.16.2",
272 - "serve-static": "1.13.2",
273 - "setprototypeof": "1.1.0",
274 - "statuses": "~1.4.0",
275 - "type-is": "~1.6.16",
276 - "utils-merge": "1.0.1",
277 - "vary": "~1.1.2"
278 - },
279 - "dependencies": {
280 - "body-parser": {
281 - "version": "1.18.2",
282 - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
283 - "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
284 - "requires": {
285 - "bytes": "3.0.0",
286 - "content-type": "~1.0.4",
287 - "debug": "2.6.9",
288 - "depd": "~1.1.1",
289 - "http-errors": "~1.6.2",
290 - "iconv-lite": "0.4.19",
291 - "on-finished": "~2.3.0",
292 - "qs": "6.5.1",
293 - "raw-body": "2.3.2",
294 - "type-is": "~1.6.15"
295 - }
296 - },
297 - "depd": {
298 - "version": "1.1.2",
299 - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
300 - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
301 - },
302 - "qs": {
303 - "version": "6.5.1",
304 - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
305 - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A=="
306 - }
307 - }
308 - },
309 - "extend": {
310 - "version": "3.0.2",
311 - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
312 - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
313 - },
314 - "extsprintf": {
315 - "version": "1.3.0",
316 - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
317 - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
318 - },
319 - "fast-deep-equal": {
320 - "version": "1.1.0",
321 - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
322 - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
323 - },
324 - "fast-json-stable-stringify": {
325 - "version": "2.0.0",
326 - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
327 - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
328 - },
329 - "finalhandler": {
330 - "version": "1.1.1",
331 - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
332 - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
333 - "requires": {
334 - "debug": "2.6.9",
335 - "encodeurl": "~1.0.2",
336 - "escape-html": "~1.0.3",
337 - "on-finished": "~2.3.0",
338 - "parseurl": "~1.3.2",
339 - "statuses": "~1.4.0",
340 - "unpipe": "~1.0.0"
341 - }
342 - },
343 - "forever-agent": {
344 - "version": "0.6.1",
345 - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
346 - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
347 - },
348 - "form-data": {
349 - "version": "2.3.2",
350 - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
351 - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
352 - "requires": {
353 - "asynckit": "^0.4.0",
354 - "combined-stream": "1.0.6",
355 - "mime-types": "^2.1.12"
356 - }
357 - },
358 - "forwarded": {
359 - "version": "0.1.2",
360 - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
361 - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
362 - },
363 - "fresh": {
364 - "version": "0.5.2",
365 - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
366 - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
367 - },
368 - "getpass": {
369 - "version": "0.1.7",
370 - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
371 - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
372 - "requires": {
373 - "assert-plus": "^1.0.0"
374 - }
375 - },
376 - "har-schema": {
377 - "version": "2.0.0",
378 - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
379 - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
380 - },
381 - "har-validator": {
382 - "version": "5.1.0",
383 - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz",
384 - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==",
385 - "requires": {
386 - "ajv": "^5.3.0",
387 - "har-schema": "^2.0.0"
388 - }
389 - },
390 - "http-errors": {
391 - "version": "1.6.3",
392 - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
393 - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
394 - "requires": {
395 - "depd": "~1.1.2",
396 - "inherits": "2.0.3",
397 - "setprototypeof": "1.1.0",
398 - "statuses": ">= 1.4.0 < 2"
399 - },
400 - "dependencies": {
401 - "depd": {
402 - "version": "1.1.2",
403 - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
404 - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
405 - }
406 - }
407 - },
408 - "http-signature": {
409 - "version": "1.2.0",
410 - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
411 - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
412 - "requires": {
413 - "assert-plus": "^1.0.0",
414 - "jsprim": "^1.2.2",
415 - "sshpk": "^1.7.0"
416 - }
417 - },
418 - "iconv-lite": {
419 - "version": "0.4.19",
420 - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
421 - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
422 - },
423 - "inherits": {
424 - "version": "2.0.3",
425 - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
426 - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
427 - },
428 - "ipaddr.js": {
429 - "version": "1.8.0",
430 - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
431 - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
432 - },
433 - "is-typedarray": {
434 - "version": "1.0.0",
435 - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
436 - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
437 - },
438 - "isstream": {
439 - "version": "0.1.2",
440 - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
441 - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
442 - },
443 - "jsbn": {
444 - "version": "0.1.1",
445 - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
446 - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
447 - "optional": true
448 - },
449 - "json-schema": {
450 - "version": "0.2.3",
451 - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
452 - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
453 - },
454 - "json-schema-traverse": {
455 - "version": "0.3.1",
456 - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
457 - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
458 - },
459 - "json-stringify-safe": {
460 - "version": "5.0.1",
461 - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
462 - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
463 - },
464 - "jsprim": {
465 - "version": "1.4.1",
466 - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
467 - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
468 - "requires": {
469 - "assert-plus": "1.0.0",
470 - "extsprintf": "1.3.0",
471 - "json-schema": "0.2.3",
472 - "verror": "1.10.0"
473 - }
474 - },
475 - "media-typer": {
476 - "version": "0.3.0",
477 - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
478 - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
479 - },
480 - "merge-descriptors": {
481 - "version": "1.0.1",
482 - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
483 - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
484 - },
485 - "methods": {
486 - "version": "1.1.2",
487 - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
488 - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
489 - },
490 - "mime": {
491 - "version": "1.4.1",
492 - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz",
493 - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
494 - },
495 - "mime-db": {
496 - "version": "1.35.0",
497 - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz",
498 - "integrity": "sha1-BWnWV0ZkkSg3CWY603mpm5DZq0c="
499 - },
500 - "mime-types": {
501 - "version": "2.1.19",
502 - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz",
503 - "integrity": "sha1-ceRkU3p++BwV8tudl+kT/A/2BvA=",
504 - "requires": {
505 - "mime-db": "~1.35.0"
506 - }
507 - },
508 - "morgan": {
509 - "version": "1.9.0",
510 - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz",
511 - "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=",
512 - "requires": {
513 - "basic-auth": "~2.0.0",
514 - "debug": "2.6.9",
515 - "depd": "~1.1.1",
516 - "on-finished": "~2.3.0",
517 - "on-headers": "~1.0.1"
518 - }
519 - },
520 - "ms": {
521 - "version": "2.0.0",
522 - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
523 - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
524 - },
525 - "negotiator": {
526 - "version": "0.6.1",
527 - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
528 - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk="
529 - },
530 - "oauth-sign": {
531 - "version": "0.9.0",
532 - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
533 - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
534 - },
535 - "on-finished": {
536 - "version": "2.3.0",
537 - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
538 - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
539 - "requires": {
540 - "ee-first": "1.1.1"
541 - }
542 - },
543 - "on-headers": {
544 - "version": "1.0.1",
545 - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz",
546 - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c="
547 - },
548 - "parseurl": {
549 - "version": "1.3.2",
550 - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
551 - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M="
552 - },
553 - "path-to-regexp": {
554 - "version": "0.1.7",
555 - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
556 - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
557 - },
558 - "performance-now": {
559 - "version": "2.1.0",
560 - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
561 - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
562 - },
563 - "proxy-addr": {
564 - "version": "2.0.4",
565 - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz",
566 - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==",
567 - "requires": {
568 - "forwarded": "~0.1.2",
569 - "ipaddr.js": "1.8.0"
570 - }
571 - },
572 - "psl": {
573 - "version": "1.1.29",
574 - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz",
575 - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ=="
576 - },
577 - "punycode": {
578 - "version": "1.4.1",
579 - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
580 - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
581 - },
582 - "qs": {
583 - "version": "6.5.2",
584 - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
585 - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
586 - },
587 - "range-parser": {
588 - "version": "1.2.0",
589 - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz",
590 - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4="
591 - },
592 - "raw-body": {
593 - "version": "2.3.2",
594 - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz",
595 - "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=",
596 - "requires": {
597 - "bytes": "3.0.0",
598 - "http-errors": "1.6.2",
599 - "iconv-lite": "0.4.19",
600 - "unpipe": "1.0.0"
601 - },
602 - "dependencies": {
603 - "http-errors": {
604 - "version": "1.6.2",
605 - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
606 - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
607 - "requires": {
608 - "depd": "1.1.1",
609 - "inherits": "2.0.3",
610 - "setprototypeof": "1.0.3",
611 - "statuses": ">= 1.3.1 < 2"
612 - }
613 - },
614 - "setprototypeof": {
615 - "version": "1.0.3",
616 - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
617 - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ="
618 - }
619 - }
620 - },
621 - "request": {
622 - "version": "2.88.0",
623 - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
624 - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
625 - "requires": {
626 - "aws-sign2": "~0.7.0",
627 - "aws4": "^1.8.0",
628 - "caseless": "~0.12.0",
629 - "combined-stream": "~1.0.6",
630 - "extend": "~3.0.2",
631 - "forever-agent": "~0.6.1",
632 - "form-data": "~2.3.2",
633 - "har-validator": "~5.1.0",
634 - "http-signature": "~1.2.0",
635 - "is-typedarray": "~1.0.0",
636 - "isstream": "~0.1.2",
637 - "json-stringify-safe": "~5.0.1",
638 - "mime-types": "~2.1.19",
639 - "oauth-sign": "~0.9.0",
640 - "performance-now": "^2.1.0",
641 - "qs": "~6.5.2",
642 - "safe-buffer": "^5.1.2",
643 - "tough-cookie": "~2.4.3",
644 - "tunnel-agent": "^0.6.0",
645 - "uuid": "^3.3.2"
646 - },
647 - "dependencies": {
648 - "safe-buffer": {
649 - "version": "5.1.2",
650 - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
651 - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
652 - }
653 - }
654 - },
655 - "safe-buffer": {
656 - "version": "5.1.1",
657 - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
658 - "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM="
659 - },
660 - "safer-buffer": {
661 - "version": "2.1.2",
662 - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
663 - "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
664 - },
665 - "send": {
666 - "version": "0.16.2",
667 - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz",
668 - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
669 - "requires": {
670 - "debug": "2.6.9",
671 - "depd": "~1.1.2",
672 - "destroy": "~1.0.4",
673 - "encodeurl": "~1.0.2",
674 - "escape-html": "~1.0.3",
675 - "etag": "~1.8.1",
676 - "fresh": "0.5.2",
677 - "http-errors": "~1.6.2",
678 - "mime": "1.4.1",
679 - "ms": "2.0.0",
680 - "on-finished": "~2.3.0",
681 - "range-parser": "~1.2.0",
682 - "statuses": "~1.4.0"
683 - },
684 - "dependencies": {
685 - "depd": {
686 - "version": "1.1.2",
687 - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
688 - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
689 - }
690 - }
691 - },
692 - "serve-favicon": {
693 - "version": "2.4.5",
694 - "resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.4.5.tgz",
695 - "integrity": "sha1-SdmkaGMVOpJAaRyJPSsOfYXW1DY=",
696 - "requires": {
697 - "etag": "~1.8.1",
698 - "fresh": "0.5.2",
699 - "ms": "2.0.0",
700 - "parseurl": "~1.3.2",
701 - "safe-buffer": "5.1.1"
702 - }
703 - },
704 - "serve-static": {
705 - "version": "1.13.2",
706 - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
707 - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
708 - "requires": {
709 - "encodeurl": "~1.0.2",
710 - "escape-html": "~1.0.3",
711 - "parseurl": "~1.3.2",
712 - "send": "0.16.2"
713 - }
714 - },
715 - "setprototypeof": {
716 - "version": "1.1.0",
717 - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
718 - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
719 - },
720 - "sshpk": {
721 - "version": "1.14.2",
722 - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz",
723 - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=",
724 - "requires": {
725 - "asn1": "~0.2.3",
726 - "assert-plus": "^1.0.0",
727 - "bcrypt-pbkdf": "^1.0.0",
728 - "dashdash": "^1.12.0",
729 - "ecc-jsbn": "~0.1.1",
730 - "getpass": "^0.1.1",
731 - "jsbn": "~0.1.0",
732 - "safer-buffer": "^2.0.2",
733 - "tweetnacl": "~0.14.0"
734 - }
735 - },
736 - "statuses": {
737 - "version": "1.4.0",
738 - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
739 - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
740 - },
741 - "tough-cookie": {
742 - "version": "2.4.3",
743 - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
744 - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
745 - "requires": {
746 - "psl": "^1.1.24",
747 - "punycode": "^1.4.1"
748 - }
749 - },
750 - "tunnel-agent": {
751 - "version": "0.6.0",
752 - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
753 - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
754 - "requires": {
755 - "safe-buffer": "^5.0.1"
756 - }
757 - },
758 - "tweetnacl": {
759 - "version": "0.14.5",
760 - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
761 - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
762 - "optional": true
763 - },
764 - "type-is": {
765 - "version": "1.6.16",
766 - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
767 - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
768 - "requires": {
769 - "media-typer": "0.3.0",
770 - "mime-types": "~2.1.18"
771 - }
772 - },
773 - "unpipe": {
774 - "version": "1.0.0",
775 - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
776 - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
777 - },
778 - "utils-merge": {
779 - "version": "1.0.1",
780 - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
781 - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
782 - },
783 - "uuid": {
784 - "version": "3.3.2",
785 - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
786 - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
787 - },
788 - "vary": {
789 - "version": "1.1.2",
790 - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
791 - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
792 - },
793 - "verror": {
794 - "version": "1.10.0",
795 - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
796 - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
797 - "requires": {
798 - "assert-plus": "^1.0.0",
799 - "core-util-is": "1.0.2",
800 - "extsprintf": "^1.2.0"
801 - }
802 - }
803 - }
804 -}
1 -{
2 - "name": "project",
3 - "version": "0.0.0",
4 - "private": true,
5 - "scripts": {
6 - "start": "node ./bin/www"
7 - },
8 - "dependencies": {
9 - "body-parser": "^1.18.3",
10 - "cookie-parser": "^1.4.3",
11 - "debug": "~2.6.9",
12 - "ejs": "~2.5.7",
13 - "express": "^4.16.3",
14 - "morgan": "^1.9.0",
15 - "request": "^2.88.0",
16 - "serve-favicon": "^2.4.5"
17 - },
18 - "main": "app.js",
19 - "devDependencies": {},
20 - "author": "",
21 - "license": "ISC",
22 - "description": ""
23 -}
1 -// Naver WEB Request
2 -var request = require('request');
3 -
4 -// Web Package
5 -var express = require('express');
6 -var app = express();
7 -
8 -// Kakao Parser
9 -var bodyParser = require('body-parser');
10 -
11 -// Naver API URL
12 -var api_url = 'https://openapi.naver.com/v1/papago/n2mt';
13 -
14 -// Naver Auth Key
15 -//새로 발급받은 naver papago api id, pw 입력
16 -var client_id = 'xZMx34y7uru1v8lywZ2d';
17 -var client_secret = 'p6L7M7WsH9';
18 -
19 -// Parse Application JSON
20 -app.use(bodyParser.json());
21 -
22 -// Parse Application/x-www-form-urlencoded
23 -app.use(bodyParser.urlencoded({ extended: true}));
24 -
25 -
26 -
27 -
28 -// Kakao Keyboard API
29 -app.get('/keyboard', function(req, res) {
30 - const menu = {
31 - "type": 'buttons',
32 - "buttons": ["시작"]
33 - };
34 - res.set({
35 - 'content-type': 'application/json'
36 - }).send(JSON.stringify(menu));
37 -});
38 -
39 -// Kakao Message API
40 -app.post('/message', function(req, res) {
41 - const _obj = {
42 - user_key: req.body.user_key,
43 - type: req.body.type,
44 - content: req.body.content
45 - };
46 -
47 - console.log(_obj.content)
48 -
49 - // Naver Papago Translate
50 - var options = {
51 - url: api_url,
52 - // 한국어(source : ko), 영어(target: en), 카톡에서 받는 메시지(text)
53 - form: {'source':'ko', 'target':'en', 'text':req.body.content},
54 - headers: {'X-Naver-Client-Id': client_id, 'X-Naver-Client-Secret': client_secret}
55 - };
56 -
57 - // Naver Post API
58 - request.post(options, function(error, response, body){
59 - // Translate API Sucess
60 - if(!error && response.statusCode == 200){
61 - // JSON
62 - var objBody = JSON.parse(response.body);
63 - // Message 잘 찍히는지 확인
64 - console.log(objBody.message.result.translatedText);
65 -
66 - // Kakao Message API
67 - let massage = {
68 - "message": {
69 - // Naver API Translate 결과를 Kakao Message
70 - "text": objBody.message.result.translatedText
71 - },
72 - };
73 -
74 - // Kakao Message API 전송
75 - res.set({
76 - 'content-type': 'application/json'
77 - }).send(JSON.stringify(massage));
78 - }else{
79 - // Naver Message Error 발생
80 - res.status(response.statusCode).end();
81 - console.log('error = ' + response.statusCode);
82 -
83 - let massage = {
84 - "message": {
85 - "text": response.statusCode
86 - },
87 - };
88 -
89 - // Kakao에 Error Message
90 - res.set({
91 - 'content-type': 'application/json'
92 - }).send(JSON.stringify(massage));
93 - }
94 - });
95 -});
96 -
97 -// whatsupdevelop.com 실행
98 -app.listen(3000, function(){
99 -});