From 55d6420f4d1c486fbb68f8f64a85779c30d657d4 Mon Sep 17 00:00:00 2001 From: ruth Date: Sun, 12 Nov 2023 04:01:16 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=B8=EC=83=81=EC=9D=98=20=EB=B9=9B?= =?UTF-8?q?=EA=B3=BC=20=EC=86=8C=EA=B8=88=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/findroad/index.js | 5 ++ api/ktx_schedule/index.js | 2 +- package-lock.json | 66 +++++++++++++++++++++++++ package.json | 1 + requirements.txt | Bin 470 -> 498 bytes src/index.html | 100 +++++++++++++++++++++++--------------- 6 files changed, 134 insertions(+), 40 deletions(-) diff --git a/api/findroad/index.js b/api/findroad/index.js index 5abdea0..47d92c7 100644 --- a/api/findroad/index.js +++ b/api/findroad/index.js @@ -1,3 +1,6 @@ +const fetch = require("node-fetch"); + + module.exports = async function (context, req) { try { const { startX, startY, endX, endY } = req.body; // 매개변수로부터 위도, 경도 정보를 받음 @@ -31,6 +34,8 @@ module.exports = async function (context, req) { const totalFare = json_response.metaData.plan.itineraries[0].fare.regular.totalFare; + //코드 추가 + context.res = { status: 200, body: { text: `Total Fare: ${totalFare} 원` }, diff --git a/api/ktx_schedule/index.js b/api/ktx_schedule/index.js index d1773e6..60deb01 100644 --- a/api/ktx_schedule/index.js +++ b/api/ktx_schedule/index.js @@ -5,7 +5,7 @@ module.exports = async function (context, req) { const date = "20231112"; const time = "120000"; - const call_command = `python ./ktx_schedule/ktx_api.py ${dep} ${arr} ${date} ${time}`; + const call_command = `python3 ./ktx_schedule/ktx_api.py ${dep} ${arr} ${date} ${time}`; // console.log(call_command); const execSync = require('child_process').execSync; diff --git a/package-lock.json b/package-lock.json index dac0728..bdf6bfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "dependencies": { "axios": "^1.6.1", + "node-fetch": "^2.7.0", "swa": "^0.0.1" }, "devDependencies": { @@ -1280,6 +1281,25 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -2135,6 +2155,11 @@ "node": ">=0.6" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -2176,6 +2201,20 @@ "wrap-fn": "^0.1.0" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -3210,6 +3249,14 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -3877,6 +3924,11 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -3912,6 +3964,20 @@ "wrap-fn": "^0.1.0" } }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 57c0fde..811f05e 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "axios": "^1.6.1", + "node-fetch": "^2.7.0", "swa": "^0.0.1" } } diff --git a/requirements.txt b/requirements.txt index b8144a546db310b3c98f38ad8d4fd2f547df6e04..1fd3cb8bcf5553f6a92f06bc28423245274d6e1c 100644 GIT binary patch delta 30 icmcb{{E2x&l5h$`Dnki_EfAVA=rI@pvBAdBT1EhUDhC1p delta 15 Wcmeywe2sZR(#EC&MiyQME(QQGC - +