Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김시환
/
emergency_room_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
윤규리
2022-11-29 10:40:27 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
05d974ba63f3dba48dd0df420f14f343a6a4342e
05d974ba
1 parent
02d90e0e
dotenv
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
7 deletions
app.js
emergency_api.js
notify_app.js
yarn-error.log
app.js
View file @
05d974b
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
;
...
...
emergency_api.js
View file @
05d974b
...
...
@@ -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'
);
/* */
...
...
notify_app.js
View file @
05d974b
...
...
@@ -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
});
...
...
yarn-error.log
0 → 100644
View file @
05d974b
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
Please
register
or
login
to post a comment