Discord 플랫폼을 위한 날씨/대기 정보 웹훅 애플리케이션 소스코드입니다
-
Prepare Openweather Map's API key. You need to subscribe apis under below
-
Git Clone
git clone https://github.com/J-hoplin1/Weather_Hook.git && cd Weather_Hook
-
Complete application config. There are three types of config
-
scheduler : Crontab Expression
-
region : Please follow format as under below
... "region" : [ { "hook" : "Your discord web hook endpoint", "region" : "Supported Region (ex. 'seoul')" } ] ...
- You can see supported region in this link
-
specified : Please follow format as under below
... "specified" : [ { "hook" : "Your discord web hook endpoint", "location" :[ "latitude value as integer type", "longtitude value as integer type", "location name you want to set as string type" ] } ] ...
-
JSON under below is example of config file
{ "scheduler": "0 */4 * * *", "region": [ { "hook": "hook endpoint", "region": "seoul" } ], "specified": [ { "hook": "hook endpoint", "location": [ 36.6210720, 127.2868270, "school" ] } ] }
-
-
Build docker
docker build -t (image name) .
-
Run docker container. Be aware that you need Openweather map API key in this step
- Mountable container volume
- /app/dist/logfile : logfiles directory
docker run -d --name (container name) -e OPENWEATHER_API_KEY='(your openweathermap API Key)' -v (location you want to mount):/app/dist/logfile (image name)
- Mountable container volume