윤규리

dotenv

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