diff --git a/src/index.js b/src/index.js index 61a76bf..b6f36bc 100644 --- a/src/index.js +++ b/src/index.js @@ -112,9 +112,14 @@ async function homePage(origin) { * Respond with whatever origin gives us * @param {Request} request */ -async function handleRequest(request) { +async function handleRequest(request, env) { let response; try { + // Check for static assets first + const url = new URL(request.url); + if (url.pathname.startsWith('/tree')) { + return env.ASSETS.fetch(request); + } // curl -b TroopMasterWebSiteID=203232 -v https://tmweb.troopmaster.com/Website/Home const origin = 'https://tmweb.troopmaster.com/Website/Home'; const originHost = 'https://tmweb.troopmaster.com'; @@ -164,5 +169,5 @@ async function handleRequest(request) { // neither browser nor node. This is the hook into the CF Worker ecosystem, // so we need to have this code and is safe to disable eslint for this line addEventListener('fetch', (event) => { // eslint-disable-line no-restricted-globals - event.respondWith(handleRequest(event.request)); + event.respondWith(handleRequest(event.request, event.env)); }); diff --git a/static/tree/index.html b/static/tree/index.html new file mode 100644 index 0000000..5ea9970 --- /dev/null +++ b/static/tree/index.html @@ -0,0 +1,277 @@ + + +
+ + +We encourage you to use our new online scheduling system!
+It's quick, easy, and helps us plan our routes efficiently.
+If you prefer not to use the online scheduling system, you can still participate:
+ +Location: Prince of Peace Lutheran Church
+ 14175 NW Cornell Rd, Portland, OR 97229
Hours: 12:00 PM - 4:00 PM on all pickup dates (January 3, 4, 10, & 11)
+ +You can drop off your tree at any time during these hours. Payment can be made via PayPal (preferred) or cash/check on-site.
+Your generous donations help support our troop's activities and adventures throughout the year!
+Check if your address is in our pickup area:
+Remove all ornaments, lights, tinsel, and decorations. We cannot accept flocked trees. Place your tree at the curb by 12:00 noon, visible from the street (not behind a car or by the garage).
+Make sure your tree is out by 12:00 noon and visible from the street. If using the traditional method (without scheduling), ensure the flyer with payment is securely attached and visible. If we haven't picked up your tree by 4:00 PM and you're in our pickup area, email us at info.Troop618@troopmaster.email or place your tree out on the next collection date.
+Sorry, we cannot accept flocked trees as they are not recyclable.
+You can drop off your tree at Prince of Peace Lutheran Church during our drop-off hours (12:00 PM - 4:00 PM on January 3, 4, 10, & 11).
+No, it's optional but highly encouraged! The scheduling system helps us plan efficient routes and ensures we don't miss your tree. However, you can still use the traditional method of placing your tree at the curb with payment attached.
+We accept PayPal (preferred), checks payable to "POPLC", and cash. If using the online scheduling system, you must pay via PayPal before scheduling.
+Your donations help fund our camping trips, community service projects, and leadership development activities.
+Interested in joining our troop?
+ We welcome youth ages 11-17 (all genders). Learn more about our troop or contact us at info.Troop618@troopmaster.email