diff --git a/src/index.js b/src/index.js index fc3eaf8..808d793 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,8 @@ export default { return await handleDefaultGet(env); case '/all': return await handleAllGet(env); + case '/qr': + return await handleQrGet(env); case '/manage': return await handleManageGet(env); case '/manage/upload': @@ -267,6 +269,52 @@ async function handleManageGet(env) { `, { headers: { 'Content-Type': 'text/html' } }); } +async function handleQrGet(env) { + const index = await getIndex(env); + const selectedFile = index.find((file) => file.selected); + + return new Response(` + + + QR Code - Tutorium Resources + + + +
+ QR Code +
+ + + + `, { headers: { 'Content-Type': 'text/html' } }); +} + // POST for "/manage/select" async function handleSelect(request, env) {