신원형

main

FROM node:latest
LABEL project="OSS Demo image"
LABEL maintainer "."
RUN apt-get update
WORKDIR /usr/app
COPY ./ /usr/app
EXPOSE 8110
RUN npm install
CMD [ "npm","start" ]
RUN cd /usr/app
RUN ls -a
\ No newline at end of file
......@@ -78,6 +78,15 @@ function filter_date(date, id, pw) {
return null
}
function is_good_weather(weather_data) {
if(weather_data.id < 800) {
return false
}
return true
}
/*
1. 사용자가 아무 메세지나 입력?
......@@ -108,11 +117,14 @@ app.post('/hook', async function (req, res) {
sendText(eventObj.replyToken, filter_result)
}
(await weather.get_weather_current()).then(it => {
const good_weather = (await weather.get_weather_current()).then(it => {
return is_good_weather(it)
})
if (!good_weather) {
sendText(eventObj.replyToken, "날씨가 나쁨")
}
res.sendStatus(200);
});
......