From 967c38beddf67b7afb58b004fe498f65fd648cf4 Mon Sep 17 00:00:00 2001 From: girinb Date: Fri, 6 Jun 2025 06:22:57 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EC=B2=9C=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EA=B9=8C=EC=A7=80=20=EC=B6=94=EA=B0=80=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 7 - functions/helloWorld1.js | 364 +++++++++++++++++++++++++++++++++++++++ functions/helloWorld2.js | 60 +++++++ functions/helloWorld3.js | 111 ++++++++++++ functions/index.js | 63 +------ 5 files changed, 541 insertions(+), 64 deletions(-) delete mode 100644 app.js create mode 100644 functions/helloWorld1.js create mode 100644 functions/helloWorld2.js create mode 100644 functions/helloWorld3.js diff --git a/app.js b/app.js deleted file mode 100644 index 035fb95..0000000 --- a/app.js +++ /dev/null @@ -1,7 +0,0 @@ -// functions/index.js - -const functions = require("firebase-functions"); - -exports.helloWorld = functions.https.onRequest((request, response) => { - response.send("Hello from Firebase!"); -}); \ No newline at end of file diff --git a/functions/helloWorld1.js b/functions/helloWorld1.js new file mode 100644 index 0000000..43c17a5 --- /dev/null +++ b/functions/helloWorld1.js @@ -0,0 +1,364 @@ +const { onRequest } = require("firebase-functions/v2/https"); + + +const jsonData = { + "P00000001": [ + { + "casestudy lesson id": "FKJDDVZX99JV", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=2qyCk5RN9LE", + "thumbnail": "https://img.youtube.com/vi/2qyCk5RN9LE/maxresdefault.jpg" + } + ], + "P00000002": [ + { + "casestudy lesson id": "ET2OAPCSJ51A", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=wUrABUiSydk&list=PL2gjxcSd5oFalcbPN3_RyaonZcmAGT55c", + "thumbnail": "https://img.youtube.com/vi/wUrABUiSydk/maxresdefault.jpg" + }, + { + "casestudy lesson id": "QNR5NHDGDS2R", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=0BhrT0JuubE&list=PL2gjxcSd5oFalcbPN3_RyaonZcmAGT55c&index=2", + "thumbnail": "https://img.youtube.com/vi/0BhrT0JuubE/maxresdefault.jpg" + }, + { + "casestudy lesson id": "QGZ6KKERGFYQ", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=_11TpUDLjfs&list=PL2gjxcSd5oFalcbPN3_RyaonZcmAGT55c&index=5", + "thumbnail": "https://img.youtube.com/vi/_11TpUDLjfs/maxresdefault.jpg" + }, + { + "casestudy lesson id": "FZGXOUWSLOFF", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=AGr2t0LCg8k&list=PL2gjxcSd5oFalcbPN3_RyaonZcmAGT55c&index=3", + "thumbnail": "https://img.youtube.com/vi/AGr2t0LCg8k/maxresdefault.jpg" + } + ], + "P00000003": [ + { + "casestudy lesson id": "JROEBRBFP4Q8", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=tgUocrkP8Es&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893", + "thumbnail": "https://img.youtube.com/vi/tgUocrkP8Es/maxresdefault.jpg" + }, + { + "casestudy lesson id": "ENHV51O8R2P1", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=F5XLuFlhINU&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893&index=2", + "thumbnail": "https://img.youtube.com/vi/F5XLuFlhINU/maxresdefault.jpg" + }, + { + "casestudy lesson id": "8XM38YEW2S06", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=pJ_X7yPI7Ow&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893&index=3", + "thumbnail": "https://img.youtube.com/vi/pJ_X7yPI7Ow/maxresdefault.jpg" + }, + { + "casestudy lesson id": "DZ0DA19PB1ZN", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=UaJFeOPtEx8&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893&index=4", + "thumbnail": "https://img.youtube.com/vi/UaJFeOPtEx8/maxresdefault.jpg" + }, + { + "casestudy lesson id": "KWGQBQZ6L38I", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=LXsFOrgbg_o&list=PLv6KfiLx9P_0uFZ_xpwutLxndmeRmDYgD", + "thumbnail": "https://img.youtube.com/vi/LXsFOrgbg_o/maxresdefault.jpg" + }, + { + "casestudy lesson id": "BYHTDB08PESR", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=jjm2Aabb2EE&list=PLv6KfiLx9P_0uFZ_xpwutLxndmeRmDYgD&index=2", + "thumbnail": "https://img.youtube.com/vi/jjm2Aabb2EE/maxresdefault.jpg" + }, + { + "casestudy lesson id": "C1U44MJI2I5Z", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=alqHjfw_HtM&list=PLv6KfiLx9P_0uFZ_xpwutLxndmeRmDYgD&index=3", + "thumbnail": "https://img.youtube.com/vi/alqHjfw_HtM/maxresdefault.jpg" + }, + { + "casestudy lesson id": "WCG02821S3HT", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=089Oo6tKCmE&list=PLv6KfiLx9P_0uFZ_xpwutLxndmeRmDYgD&index=4", + "thumbnail": "https://img.youtube.com/vi/089Oo6tKCmE/maxresdefault.jpg" + }, + { + "casestudy lesson id": "W2QGCL0RYFAI", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=1KKXDBzGafo&list=PL4TBSI7_RtBbbWV9Lf1cVXvxg9ipktt3s", + "thumbnail": "https://img.youtube.com/vi/1KKXDBzGafo/maxresdefault.jpg" + }, + { + "casestudy lesson id": "SC9SRIAH0CFI", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=5K4qJnNuaP8&list=PL4TBSI7_RtBbbWV9Lf1cVXvxg9ipktt3s&index=2", + "thumbnail": "https://img.youtube.com/vi/5K4qJnNuaP8/maxresdefault.jpg" + }, + { + "casestudy lesson id": "4GON1UDTRMLS", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=Akn397pbyIo&list=PL4TBSI7_RtBbbWV9Lf1cVXvxg9ipktt3s&index=3", + "thumbnail": "https://img.youtube.com/vi/Akn397pbyIo/maxresdefault.jpg" + }, + { + "casestudy lesson id": "GBLVZHX7TDJ4", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=GTt18ZV31QE&list=PL4TBSI7_RtBbbWV9Lf1cVXvxg9ipktt3s&index=4", + "thumbnail": "https://img.youtube.com/vi/GTt18ZV31QE/maxresdefault.jpg" + }, + { + "casestudy lesson id": "HVJ2MIY116Q8", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=PxPzNdrqhX4&list=PL4TBSI7_RtBbbWV9Lf1cVXvxg9ipktt3s&index=5", + "thumbnail": "https://img.youtube.com/vi/PxPzNdrqhX4/maxresdefault.jpg" + }, + { + "casestudy lesson id": "IQBSFQ4TQ5QD", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=lR3UUbQsDgA&list=PLV7hU9BBDbaTXgM6bJz2d2vdazJe6MT7H", + "thumbnail": "https://img.youtube.com/vi/lR3UUbQsDgA/maxresdefault.jpg" + }, + { + "casestudy lesson id": "ZTGN1NCSKBES", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=69u48Ghc6Ss&list=PLV7hU9BBDbaTXgM6bJz2d2vdazJe6MT7H&index=2", + "thumbnail": "https://img.youtube.com/vi/69u48Ghc6Ss/maxresdefault.jpg" + }, + { + "casestudy lesson id": "DVHCZKRJ4RDV", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=AIPcgBOSjM0&list=PLV7hU9BBDbaTXgM6bJz2d2vdazJe6MT7H&index=3", + "thumbnail": "https://img.youtube.com/vi/AIPcgBOSjM0/maxresdefault.jpg" + }, + { + "casestudy lesson id": "ZO1FYPQCLO6S", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=hhj2GWKDe-A&list=PLV7hU9BBDbaTXgM6bJz2d2vdazJe6MT7H&index=4", + "thumbnail": "https://img.youtube.com/vi/hhj2GWKDe-A/maxresdefault.jpg" + }, + { + "casestudy lesson id": "RC4C7O97HE5Z", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=se9eO9ZcE5Q&list=PLV7hU9BBDbaTXgM6bJz2d2vdazJe6MT7H&index=5", + "thumbnail": "https://img.youtube.com/vi/se9eO9ZcE5Q/maxresdefault.jpg" + }, + { + "casestudy lesson id": "CWEDI9YY2XZ0", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=sSgB2zr7Nm0&list=PLV7hU9BBDbaTJM6f5WHLJkHOZxJthtVJV", + "thumbnail": "https://img.youtube.com/vi/sSgB2zr7Nm0/maxresdefault.jpg" + }, + { + "casestudy lesson id": "WUWSUWN3XY14", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=0iCz7LXjOkY&list=PLV7hU9BBDbaTJM6f5WHLJkHOZxJthtVJV&index=2", + "thumbnail": "https://img.youtube.com/vi/0iCz7LXjOkY/maxresdefault.jpg" + }, + { + "casestudy lesson id": "7343601RUFFE", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=LNbDHGZR1Zk&list=PLV7hU9BBDbaTJM6f5WHLJkHOZxJthtVJV&index=3", + "thumbnail": "https://img.youtube.com/vi/LNbDHGZR1Zk/maxresdefault.jpg" + }, + { + "casestudy lesson id": "DEJV2F2PN8U4", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=4qCfvoQi758&list=PLV7hU9BBDbaTJM6f5WHLJkHOZxJthtVJV&index=4", + "thumbnail": "https://img.youtube.com/vi/4qCfvoQi758/maxresdefault.jpg" + }, + { + "casestudy lesson id": "P5LI77JGHPBM", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=kL8TGz_kM8U&list=PLV7hU9BBDbaTJM6f5WHLJkHOZxJthtVJV&index=5", + "thumbnail": "https://img.youtube.com/vi/kL8TGz_kM8U/maxresdefault.jpg" + } + ], "P00000004": [ + { + "casestudy lesson id": "P6WMFVVE1JHN", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=5PNotJrwkYY&list=PLWYr0cX0QTLCzRlSioyNG90GgvblR33j7", + "thumbnail": "https://img.youtube.com/vi/5PNotJrwkYY/maxresdefault.jpg" + }, + { + "casestudy lesson id": "AAWW9UG1SKG7", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=IuDqKgGsEA4&list=PLWYr0cX0QTLCzRlSioyNG90GgvblR33j7&index=2", + "thumbnail": "https://img.youtube.com/vi/IuDqKgGsEA4/maxresdefault.jpg" + }, + { + "casestudy lesson id": "FA6LVSMOWRZ8", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=pfFSyoduDe4&list=PLWYr0cX0QTLCzRlSioyNG90GgvblR33j7&index=3", + "thumbnail": "https://img.youtube.com/vi/pfFSyoduDe4/maxresdefault.jpg" + }, + { + "casestudy lesson id": "VQHSSYSUOJ2W", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=jj5QK7gcJTI&list=PLWYr0cX0QTLCzRlSioyNG90GgvblR33j7&index=4", + "thumbnail": "https://img.youtube.com/vi/jj5QK7gcJTI/maxresdefault.jpg" + }, + { + "casestudy lesson id": "TWX2RJH4EWXL", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=U15Eqg_kDCU&list=PLWYr0cX0QTLCzRlSioyNG90GgvblR33j7&index=5", + "thumbnail": "https://img.youtube.com/vi/U15Eqg_kDCU/maxresdefault.jpg" + }, + { + "casestudy lesson id": "89BWM83JDQ2Z", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=ea4J80ybzqY&list=PLWYr0cX0QTLCzRlSioyNG90GgvblR33j7&index=6", + "thumbnail": "https://img.youtube.com/vi/ea4J80ybzqY/maxresdefault.jpg" + }, + { + "casestudy lesson id": "IGVK3F3K09ME", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=yFXHull0s0I&list=PLWYr0cX0QTLCzRlSioyNG90GgvblR33j7&index=7", + "thumbnail": "https://img.youtube.com/vi/yFXHull0s0I/maxresdefault.jpg" + }, + { + "casestudy lesson id": "4IZW54RZW844", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=N-xuqy6x1Bw&list=PLgGbWId6zgaXt4qt5CCLlZRTbyWsQKAPx", + "thumbnail": "https://img.youtube.com/vi/N-xuqy6x1Bw/maxresdefault.jpg" + }, + { + "casestudy lesson id": "5GZGNW3FD7CT", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=HvkmJ3Ec-hU&list=PLgGbWId6zgaXt4qt5CCLlZRTbyWsQKAPx&index=2", + "thumbnail": "https://img.youtube.com/vi/HvkmJ3Ec-hU/maxresdefault.jpg" + }, + { + "casestudy lesson id": "TSZ06APM2FL5", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=BB6HiXvtcMQ&list=PLgGbWId6zgaXt4qt5CCLlZRTbyWsQKAPx&index=3", + "thumbnail": "https://img.youtube.com/vi/BB6HiXvtcMQ/maxresdefault.jpg" + } + ], "P00000005": [ + { + "casestudy lesson id": "FK9SG7ZT4K5A", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=yrt2qxu3ltc&list=PLsgNuGaOCZRtBCEmb6JUxOcm9dI2X3p7A", + "thumbnail": "https://img.youtube.com/vi/yrt2qxu3ltc/maxresdefault.jpg" + }, + { + "casestudy lesson id": "4XZK2ITCLS37", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=Pet-8Y87BEw&list=PLsgNuGaOCZRtBCEmb6JUxOcm9dI2X3p7A&index=2", + "thumbnail": "https://img.youtube.com/vi/Pet-8Y87BEw/maxresdefault.jpg" + } + ], + "P00000006": [ + { + "casestudy lesson id": "RNFMCD6454CA", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=RNqB5XHgivQ&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ", + "thumbnail": "https://img.youtube.com/vi/RNqB5XHgivQ/maxresdefault.jpg" + }, + { + "casestudy lesson id": "EUGSRJ7QW1K7", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=7F7um7l5AqU&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=2", + "thumbnail": "https://img.youtube.com/vi/7F7um7l5AqU/maxresdefault.jpg" + }, + { + "casestudy lesson id": "PW9S4UGBP6Q8", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=2U6eKkAmWDg&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=3", + "thumbnail": "https://img.youtube.com/vi/2U6eKkAmWDg/maxresdefault.jpg" + }, + { + "casestudy lesson id": "R8N2TFRZ5FGV", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=BwzzJhje6ms&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=4", + "thumbnail": "https://img.youtube.com/vi/BwzzJhje6ms/maxresdefault.jpg" + }, + { + "casestudy lesson id": "XWSFL61B84BA", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=p7mcSCmxB2g&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=5", + "thumbnail": "https://img.youtube.com/vi/p7mcSCmxB2g/maxresdefault.jpg" + }, + { + "casestudy lesson id": "4UHBTNO67WH5", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=IsDYrpsX-pU&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=6", + "thumbnail": "https://img.youtube.com/vi/IsDYrpsX-pU/maxresdefault.jpg" + }, + { + "casestudy lesson id": "STYO6JGYOLTR", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=raME1ybsINc&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=7", + "thumbnail": "https://img.youtube.com/vi/raME1ybsINc/maxresdefault.jpg" + }, + { + "casestudy lesson id": "OLB3LM5B54UR", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=bdFQ79Mq1yk&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=8", + "thumbnail": "https://img.youtube.com/vi/bdFQ79Mq1yk/maxresdefault.jpg" + }, + { + "casestudy lesson id": "UFF14JQX5IFG", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=dqXq0RDWBSA&list=PLGEvszL7OKkNguughc__-ToJRxgXD2JYJ&index=9", + "thumbnail": "https://img.youtube.com/vi/dqXq0RDWBSA/maxresdefault.jpg" + } + ], "P00000007": [ + { + "casestudy lesson id": "39EEOXV14OPC", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=ZzcgdNpw_cI&list=PLifnQOsGyOSTYxFVLLZQo0MPEP2e5dh1Q", + "thumbnail": "https://img.youtube.com/vi/ZzcgdNpw_cI/maxresdefault.jpg" + }, + { + "casestudy lesson id": "Q5CAS5PHGUZS", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=b1SD4PAXBQs&list=PLifnQOsGyOSTYxFVLLZQo0MPEP2e5dh1Q&index=2", + "thumbnail": "https://img.youtube.com/vi/b1SD4PAXBQs/maxresdefault.jpg" + }, + { + "casestudy lesson id": "BM3QW7IIBPHA", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=WfmoqKNUwBg&list=PLifnQOsGyOSTYxFVLLZQo0MPEP2e5dh1Q&index=3", + "thumbnail": "https://img.youtube.com/vi/WfmoqKNUwBg/maxresdefault.jpg" + }, + { + "casestudy lesson id": "5RM7VSIDOBM5", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=NFX5p1G1t1Q&list=PLifnQOsGyOSTYxFVLLZQo0MPEP2e5dh1Q&index=4", + "thumbnail": "https://img.youtube.com/vi/NFX5p1G1t1Q/maxresdefault.jpg" + }, + { + "casestudy lesson id": "7AMW56IMB70H", + "lesson tag": "YouTube", + "lesson url": "https://www.youtube.com/watch?v=WfAjE5-2Vcs&list=PLifnQOsGyOSTYxFVLLZQo0MPEP2e5dh1Q&index=5", + "thumbnail": "https://img.youtube.com/vi/WfAjE5-2Vcs/maxresdefault.jpg" + } + ], "P00000008": [ + { + "casestudy lesson id": "RFZ3XH3410R0", + "lesson tag": "YouTube", + "lesson url": "https://www.loom.com/share/be9e59e40bcf4a018f64d6a7301e7a88?sid=0b4ab31b-8449-4b55-b1d4-dac3369a60eb", + "thumbnail": "https://img.youtube.com/vi/be9e59e40bc/maxresdefault.jpg" + } + + ] +}; + + + +exports.helloWorld1 = onRequest((req, res) => { + const id = req.query.id || req.body.id; // URL 쿼리 또는 POST 요청에서 ID를 받음 + + let responseData; + responseData = jsonData[id] || []; + if (responseData.length === 0) { + responseData = { error: "No data found for the given ID" }; + } + res.status(200).json({ "data": responseData }); +}); + + + diff --git a/functions/helloWorld2.js b/functions/helloWorld2.js new file mode 100644 index 0000000..e0b4837 --- /dev/null +++ b/functions/helloWorld2.js @@ -0,0 +1,60 @@ +const { onRequest } = require("firebase-functions/v2/https"); + +exports.helloWorld2 = onRequest((req, res) => { + const jsonData = { + "data": [ + { + "planId": "P00000001", + "planTitle": "Data Labeling", + "planTeacher": "Sorry Lee", + "thumbnail": "https://img.youtube.com/vi/2qyCk5RN9LE/maxresdefault.jpg" + }, + { + "planId": "P00000002", + "planTitle": "Robot Journalism", + "planTeacher": "Sorry Lee", + "thumbnail": "https://img.youtube.com/vi/wUrABUiSydk/maxresdefault.jpg" + }, + { + "planId": "P00000003", + "planTitle": "marketing_basic", + "planTeacher": "Ovais Ahmad", + "thumbnail": "https://img.youtube.com/vi/tgUocrkP8Es/maxresdefault.jpg" + }, + { + "planId": "P00000004", + "planTitle": "motion graphic_basic", + "planTeacher": "Motion Grapher", + "thumbnail": "https://img.youtube.com/vi/5PNotJrwkYY/maxresdefault.jpg" + }, + { + "planId": "P00000005", + "planTitle": "Open Animation Portfolio", + "planTeacher": "Nastia", + "thumbnail": "https://img.youtube.com/vi/Pet-8Y87BEw/maxresdefault.jpg" + }, + { + "planId": "P00000006", + "planTitle": "Excel Lesson", + "planTeacher": "Randy", + "thumbnail": "https://img.youtube.com/vi/RNqB5XHgivQ/maxresdefault.jpg" + }, + { + "planId": "P00000007", + "planTitle": "Amazon affilate Marketing", + "planTeacher": "Ankur", + "thumbnail": "https://img.youtube.com/vi/ZzcgdNpw_cI/maxresdefault.jpg" + }, + { + "planId": "P00000008", + "planTitle": "Korean Conversation", + "planTeacher": "Dayna Lee", + "thumbnail": "https://img.youtube.com/vi/be9e59e40bc/maxresdefault.jpg" + }, + ] + }; + + res.json(jsonData); +}); + + diff --git a/functions/helloWorld3.js b/functions/helloWorld3.js new file mode 100644 index 0000000..b6028e2 --- /dev/null +++ b/functions/helloWorld3.js @@ -0,0 +1,111 @@ +const { onRequest } = require("firebase-functions/v2/https"); + + +const jsonData = { + data: + [ + { + "plan id": "P00000001", + "plane name": "Plane 1", + "thumbnail": "https://img.youtube.com/vi/atbxV3EZ7is/maxresdefault.jpg" + } + , + { + "plan id": "P00000002", + "plane name": "Plane 2", + "thumbnail": "https://img.youtube.com/vi/wUrABUiSydk/maxresdefault.jpg" + } + , + { + "plan id": "P00000003", + "plane name": "Plane 3", + "thumbnail": "https://img.youtube.com/vi/tgUocrkP8Es/maxresdefault.jpg" + }, + { + "plan id": "P00000004", + + "plane name": "Plane 4", + "thumbnail": "https://img.youtube.com/vi/4qCfvoQi758/maxresdefault.jpg" + }, + { + "plan id": "P00000005", + + "plane name": "Plane 5", + "thumbnail": "https://img.youtube.com/vi/kL8TGz_kM8U/maxresdefault.jpg" + }, + { + "plan id": "P00000006", + + "plane name": "Plane 6", + "thumbnail": "https://img.youtube.com/vi/IuDqKgGsEA4/maxresdefault.jpg" + }, + { + "plan id": "P00000007", + "plane name": "Plane 7", + "thumbnail": "https://img.youtube.com/vi/pfFSyoduDe4/maxresdefault.jpg" + }, + { + "plan id": "P00000008", + + "plane name": "Plane 8", + "thumbnail": "https://img.youtube.com/vi/jj5QK7gcJTI/maxresdefault.jpg" + }, + { + "plan id": "P00000009", + + "plane name": "Plane 9", + "thumbnail": "https://img.youtube.com/vi/U15Eqg_kDCU/maxresdefault.jpg" + }, + { + "plan id": "P00000010", + "plane name": "Plane 10", + + "thumbnail": "https://img.youtube.com/vi/ea4J80ybzqY/maxresdefault.jpg" + }, + { + "plan id": "P00000011", + + "plane name": "Plane 11", + "thumbnail": "https://img.youtube.com/vi/yFXHull0s0I/maxresdefault.jpg" + }, + { + "plan id": "P00000012", + + "plane name": "Plane 12", + "thumbnail": "https://img.youtube.com/vi/N-xuqy6x1Bw/maxresdefault.jpg" + }, + { + "plan id": "P00000013", + "plane name": "Plane 13", + "thumbnail": "https://img.youtube.com/vi/HvkmJ3Ec-hU/maxresdefault.jpg" + }, + { + "plan id": "P00000014", + "lesson url": "https://www.youtube.com/watch?v=BB6HiXvtcMQ&list=PLgGbWId6zgaXt4qt5CCLlZRTbyWsQKAPx&index=3", + "thumbnail": "https://img.youtube.com/vi/BB6HiXvtcMQ/maxresdefault.jpg" + }, + { + "plan id": "P00000015", + "plane name": "Plane 14", + "thumbnail": "https://img.youtube.com/vi/yrt2qxu3ltc/maxresdefault.jpg" + }, + { + "plan id": "P00000016", + "plane name": "Plane 16", + "thumbnail": "https://img.youtube.com/vi/Pet-8Y87BEw/maxresdefault.jpg" + } + ] +}; + + + +exports.helloWorld3 = onRequest((req, res) => { + + let responseData; + responseData = jsonData; + + res.status(200).json(responseData); +}); + + + diff --git a/functions/index.js b/functions/index.js index 0545453..d6ed92f 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1,58 +1,7 @@ -const { onRequest } = require("firebase-functions/v2/https"); +const { helloWorld1 } = require("./helloWorld1"); +const { helloWorld2 } = require("./helloWorld2"); +const { helloWorld3 } = require("./helloWorld3"); -exports.helloWorld = onRequest((req, res) => { - const jsonData = { - "casestudy_lessons": [ - { - "lesson_id": "NZSKGBZA0YI8", - "lesson_tag": "YouTube", - "lesson_url": "https://www.youtube.com/watch?v=tgUocrkP8Es&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893", - "thumbnail": "https://img.youtube.com/vi/tgUocrkP8Es/maxresdefault.jpg" - }, - { - "lesson_id": "EIUQAOS19PO9", - "lesson_tag": "YouTube", - "lesson_url": "https://www.youtube.com/watch?v=F5XLuFlhINU&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893&index=2", - "thumbnail": "https://img.youtube.com/vi/F5XLuFlhINU/maxresdefault.jpg" - }, - { - "lesson_id": "W1E8UI5QEASQ", - "lesson_tag": "YouTube", - "lesson_url": "https://www.youtube.com/watch?v=pJ_X7yPI7Ow&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893&index=3", - "thumbnail": "https://img.youtube.com/vi/pJ_X7yPI7Ow/maxresdefault.jpg" - }, - { - "lesson_id": "J4XJNBZ45R7Y", - "lesson_tag": "YouTube", - "lesson_url": "https://www.youtube.com/watch?v=UaJFeOPtEx8&list=PLv6KfiLx9P_1uHbOn0lNz06ZsXFRls893&index=4", - "thumbnail": "https://img.youtube.com/vi/UaJFeOPtEx8/maxresdefault.jpg" - }, - { - "lesson_id": "WC4DS2CXAWEQ", - "lesson_tag": "YouTube", - "lesson_url": "https://www.youtube.com/watch?v=LXsFOrgbg_o&list=PLv6KfiLx9P_0uFZ_xpwutLxndmeRmDYgD", - "thumbnail": "https://img.youtube.com/vi/LXsFOrgbg_o/maxresdefault.jpg" - }, - { - "lesson_id": "OXD8FLUNG28O", - "lesson_tag": "YouTube", - "lesson_url": "https://www.youtube.com/watch?v=jjm2Aabb2EE&list=PLv6KfiLx9P_0uFZ_xpwutLxndmeRmDYgD&index=2", - "thumbnail": "https://img.youtube.com/vi/jjm2Aabb2EE/maxresdefault.jpg" - }, - { - "lesson_id": "C9BPD0CCBZCU", - "lesson_tag": "영상 ID를 찾을 수 없음", - "lesson_url": null, - "thumbnail": null - }, - { - "lesson_id": "4AUOR21NV8LI", - "lesson_tag": "영상 ID를 찾을 수 없음", - "lesson_url": null, - "thumbnail": null - } - ] - }; - - res.json(jsonData); -}); \ No newline at end of file +exports.helloWorld1 = helloWorld1; +exports.helloWorld2 = helloWorld2; +exports.helloWorld3 = helloWorld3; \ No newline at end of file