윤규리

dotenv

1 const Address = require('./Address.js'); 1 const Address = require('./Address.js');
2 const express = require('express'); 2 const express = require('express');
3 const request = require('request'); 3 const request = require('request');
4 -require("dotenv").config("/home/ec2-user/OSS/Experiments/messenger/chat/custom_modules/.env"); 4 +require("dotenv").config( {path: "/home/ec2-user/OSS/Experiments/messenger/chat/custom_modules/.env"} );
5 // const KAKAO_KEY = process.env.KAKAO_KEY; 5 // const KAKAO_KEY = process.env.KAKAO_KEY;
6 const TOKEN = process.env.CHANNEL_ACCESS_TOKEN; 6 const TOKEN = process.env.CHANNEL_ACCESS_TOKEN;
7 7
......
...@@ -2,12 +2,13 @@ const express = require('express'); ...@@ -2,12 +2,13 @@ const express = require('express');
2 const app = express(); 2 const app = express();
3 const request = require('request'); 3 const request = require('request');
4 const convert = require("xml-js"); 4 const convert = require("xml-js");
5 +require("dotenv").config( {path: "/home/ec2-user/project/emergency_room_ChatBot/.env"} );
6 +const EMERGENCY_KEY=process.env.EMERGENCY_KEY;
5 7
6 var url = 'http://apis.data.go.kr/B552657/ErmctInfoInqireService/getSrsillDissAceptncPosblInfoInqire'; 8 var url = 'http://apis.data.go.kr/B552657/ErmctInfoInqireService/getSrsillDissAceptncPosblInfoInqire';
7 -var queryParams = '?' + encodeURIComponent('serviceKey') + '=52tXHgaW46YUpGn9k0r3IQrduIl6kBOl3Ta8Idra1%2BpPMYhL4qVCDu9itW8FVbDtMF4f9LAT9NJXEx7pvEJv%2FQ%3D%3D'; /* Service Key*/ 9 +var queryParams = '?' + encodeURIComponent('serviceKey') + EMERGENCY_KEY;
8 - 10 +queryParams += '&' + encodeURIComponent('STAGE1') + '=' + encodeURIComponent('����Ư����'); /* */
9 -queryParams += '&' + encodeURIComponent('STAGE1') + '=' + encodeURIComponent('¼­¿ïƯº°½Ã'); /* */ 11 +queryParams += '&' + encodeURIComponent('STAGE2') + '=' + encodeURIComponent('������'); /* */
10 -queryParams += '&' + encodeURIComponent('STAGE2') + '=' + encodeURIComponent('°­³²±¸'); /* */
11 queryParams += '&' + encodeURIComponent('SM_TYPE') + '=' + encodeURIComponent(''); /* */ 12 queryParams += '&' + encodeURIComponent('SM_TYPE') + '=' + encodeURIComponent(''); /* */
12 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */ 13 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */
13 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('10'); /* */ 14 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('10'); /* */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 const request = require('request'); 2 const request = require('request');
3 // 요청을 위한 상수를 선언합니다: TOKEN은 자신의 것을 입력해주세요. 3 // 요청을 위한 상수를 선언합니다: TOKEN은 자신의 것을 입력해주세요.
4 const TARGET_URL = 'https://notify-api.line.me/api/notify'; 4 const TARGET_URL = 'https://notify-api.line.me/api/notify';
5 -require("dotenv").config("/home/ec2-user/OSS/Experiments/messenger/chat/custom_modules/.env"); 5 +require("dotenv").config( {path: "/home/ec2-user/OSS/Experiments/messenger/chat/custom_modules/.env"} );
6 // const KAKAO_KEY = process.env.KAKAO_KEY; 6 // const KAKAO_KEY = process.env.KAKAO_KEY;
7 const TOKEN = process.env.CHANNEL_ACCESS_TOKEN; 7 const TOKEN = process.env.CHANNEL_ACCESS_TOKEN;
8 request.post( 8 request.post(
...@@ -18,4 +18,5 @@ request.post( ...@@ -18,4 +18,5 @@ request.post(
18 } 18 }
19 },(error, response, body) => { 19 },(error, response, body) => {
20 console.log(body) 20 console.log(body)
21 - });
...\ No newline at end of file ...\ No newline at end of file
21 + });
22 +
......
1 +Arguments:
2 + /home/ec2-user/.nvm/versions/node/v16.18.1/bin/node /home/ec2-user/.nvm/versions/node/v16.18.1/bin/yarn add
3 +
4 +PATH:
5 + /home/ec2-user/.vscode-server/bin/6261075646f055b99068d3688932416f2346dd3b/bin/remote-cli:/home/ec2-user/.nvm/versions/node/v16.18.1/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user/bin
6 +
7 +Yarn version:
8 + 1.22.19
9 +
10 +Node version:
11 + 16.18.1
12 +
13 +Platform:
14 + linux x64
15 +
16 +Trace:
17 + SyntaxError: /home/ec2-user/project/emergency_room_ChatBot/package.json: Unexpected token < in JSON at position 22
18 + at JSON.parse (<anonymous>)
19 + at /home/ec2-user/.nvm/versions/node/v16.18.1/lib/node_modules/yarn/lib/cli.js:1629:59
20 + at Generator.next (<anonymous>)
21 + at step (/home/ec2-user/.nvm/versions/node/v16.18.1/lib/node_modules/yarn/lib/cli.js:310:30)
22 + at /home/ec2-user/.nvm/versions/node/v16.18.1/lib/node_modules/yarn/lib/cli.js:321:13
23 +
24 +npm manifest:
25 + {
26 + "dependencies": {
27 + <<<<<<< HEAD
28 + "request": "^2.88.2"
29 + =======
30 + "express": "^4.18.2",
31 + "node-fetch": "^2.6.7",
32 + "node-fetch-npm": "^2.0.4",
33 + "request": "^2.88.2",
34 + "xml-js": "^1.6.11"
35 + >>>>>>> main
36 + }
37 + }
38 +
39 +yarn manifest:
40 + No manifest
41 +
42 +Lockfile:
43 + No lockfile