← back to Jill Website
server.js
805 lines
#!/usr/bin/env node
// Register ts-node to support TypeScript imports
require('ts-node').register({
compilerOptions: {
module: 'commonjs'
}
});
const fs = require('fs');
const path = require('path');
const express = require('express');
// Create project structure
const createProjectStructure = () => {
const directories = [
'public',
'public/css',
'public/js',
'public/images',
'public/images/seasons',
'views',
'views/partials'
];
directories.forEach(dir => {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
});
};
// HTML Template
const indexHTML = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nosara Beachfront Rentals - Luxury Ocean Villas Costa Rica</title>
<meta name="description" content="Luxury beachfront vacation rentals in Nosara, Costa Rica. Private villas with ocean views, saltwater pools, and direct beach access.">
<link rel="stylesheet" href="/css/style.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_MAPS_API_KEY&libraries=geometry,places"></script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar">
<div class="nav-container">
<div class="nav-logo">
<h2>Nosara Beachfront</h2>
</div>
<ul class="nav-menu">
<li><a href="#home" class="nav-link">Home</a></li>
<li><a href="#villas" class="nav-link">Villas</a></li>
<li><a href="#experiences" class="nav-link">Experiences</a></li>
<li><a href="#seasons" class="nav-link">Seasons</a></li>
<li><a href="#area" class="nav-link">The Area</a></li>
<li><a href="#history" class="nav-link">History</a></li>
<li><a href="#contact" class="nav-link">Contact</a></li>
</ul>
<div class="hamburger">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
</div>
</nav>
<!-- Hero Section -->
<section id="home" class="hero">
<div class="hero-logo">
<img src="https://nosarabeachfrontrentals.com/wp-content/uploads/2024/01/casa-celajes-straight-w-image.png" alt="Casa Celajes - Nosara Beachfront Rentals">
</div>
<div class="hero-content">
<div class="hero-text">
<h1 class="hero-title">Paradise Found</h1>
<p class="hero-subtitle">Luxury beachfront villas at the mouth of Rio Nosara</p>
<div class="hero-buttons">
<a href="#villas" class="btn-primary">Explore Villas</a>
<a href="#contact" class="btn-secondary">Book Now</a>
</div>
</div>
</div>
<div class="hero-scroll">
<span>Scroll to explore</span>
<div class="scroll-arrow"></div>
</div>
</section>
<!-- Quick Stats -->
<section class="stats">
<div class="container">
<div class="stats-grid">
<div class="stat-item">
<h3>3</h3>
<p>Luxury Villas</p>
</div>
<div class="stat-item">
<h3>Beachfront</h3>
<p>Ocean Access</p>
</div>
<div class="stat-item">
<h3>Private</h3>
<p>Saltwater Pool</p>
</div>
<div class="stat-item">
<h3>Year-Round</h3>
<p>Paradise</p>
</div>
</div>
</div>
</section>
<!-- Villas Section -->
<section id="villas" class="villas">
<div class="container">
<div class="section-header">
<h2>Our Luxury Villas</h2>
<p>Each villa offers a unique experience while maintaining the highest standards of luxury and comfort</p>
</div>
<div class="villas-grid">
<!-- Casita del Garage -->
<div class="villa-card">
<div class="villa-image">
<img src="https://nosarabeachfrontrentals.com/wp-content/uploads/2025/02/casita_bedlivingrom-small.jpg" alt="Casita del Garage" style="width: 100%; height: 100%; object-fit: cover;">
<div class="villa-badge">Intimate Retreat</div>
</div>
<div class="villa-content">
<h3>Casita del Garage</h3>
<div class="villa-specs">
<span><i class="fas fa-users"></i> Sleeps 2</span>
<span><i class="fas fa-bed"></i> Double Bed</span>
<span><i class="fas fa-ruler"></i> 40m² / 430ft²</span>
</div>
<p>A special tiny home experience with complete privacy. Built over the garage with private stairs, full kitchen, and a balcony hammock overlooking the Pacific.</p>
<div class="villa-amenities">
<span>Full Kitchen</span>
<span>Private Balcony</span>
<span>Ocean Views</span>
<span>Hammock</span>
</div>
<a href="#contact" class="btn-villa">Book Now</a>
</div>
</div>
<!-- Casita del Sol -->
<div class="villa-card">
<div class="villa-image">
<img src="https://nosarabeachfrontrentals.com/wp-content/uploads/2025/02/sol_bedroom-2-3.jpg" alt="Casita del Sol" style="width: 100%; height: 100%; object-fit: cover;">
<div class="villa-badge">Sun Villa</div>
</div>
<div class="villa-content">
<h3>Casita del Sol</h3>
<div class="villa-specs">
<span><i class="fas fa-users"></i> Sleeps 4</span>
<span><i class="fas fa-bed"></i> Queen + Sofa Bed</span>
<span><i class="fas fa-ruler"></i> 76m² / 818ft²</span>
</div>
<p>First floor of our newly-built oceanfront house. Private entrance with shared beachfront saltwater pool. Steps from surfing and tide pools.</p>
<div class="villa-amenities">
<span>Saltwater Pool</span>
<span>Beach Access</span>
<span>Tide Pools</span>
<span>Surf Nearby</span>
</div>
<a href="#contact" class="btn-villa">Book Now</a>
</div>
</div>
<!-- Casita de la Luna -->
<div class="villa-card">
<div class="villa-image">
<img src="https://nosarabeachfrontrentals.com/wp-content/uploads/2025/02/luna_bed-small.jpg" alt="Casita de la Luna" style="width: 100%; height: 100%; object-fit: cover;">
<div class="villa-badge">Moon Villa</div>
</div>
<div class="villa-content">
<h3>Casita de la Luna</h3>
<div class="villa-specs">
<span><i class="fas fa-users"></i> Sleeps 4</span>
<span><i class="fas fa-bed"></i> Queen + Sofa Bed</span>
<span><i class="fas fa-ruler"></i> 76m² / 818ft²</span>
</div>
<p>Twin to Casita del Sol, offering the same luxury amenities. Perfect for groups or families wanting to stay close while maintaining privacy.</p>
<div class="villa-amenities">
<span>Saltwater Pool</span>
<span>Beach Access</span>
<span>SUP Access</span>
<span>Wilderness Views</span>
</div>
<a href="#contact" class="btn-villa">Book Now</a>
</div>
</div>
</div>
</div>
</section>
<!-- Seasons Section -->
<section id="seasons" class="seasons">
<div class="container">
<div class="section-header">
<h2>Experience Every Season</h2>
<p>Nosara offers year-round beauty with distinct seasonal experiences</p>
</div>
<div class="seasons-grid">
<div class="season-card">
<div class="season-image dry-season">
<div class="season-overlay">
<h3>Dry Season</h3>
<span>December - April</span>
</div>
</div>
<div class="season-content">
<h4>Perfect Beach Weather</h4>
<p>Sunny skies, minimal rainfall, and consistent offshore winds create ideal conditions for surfing, sunbathing, and outdoor adventures.</p>
<ul>
<li>Average temp: 85°F (29°C)</li>
<li>Minimal rainfall</li>
<li>Perfect surf conditions</li>
<li>Ideal for wildlife watching</li>
</ul>
</div>
</div>
<div class="season-card">
<div class="season-image green-season">
<div class="season-overlay">
<h3>Green Season</h3>
<span>May - November</span>
</div>
</div>
<div class="season-content">
<h4>Lush Paradise</h4>
<p>Afternoon rains bring vibrant greens, fewer crowds, and dramatic skies. Perfect for those seeking a more authentic tropical experience.</p>
<ul>
<li>Average temp: 82°F (28°C)</li>
<li>Afternoon showers</li>
<li>Lush vegetation</li>
<li>Better wildlife sightings</li>
</ul>
</div>
</div>
<div class="season-card">
<div class="season-image turtle-season">
<div class="season-overlay">
<h3>Turtle Season</h3>
<span>July - December</span>
</div>
</div>
<div class="season-content">
<h4>Wildlife Spectacle</h4>
<p>Witness the incredible arribada when thousands of Olive Ridley sea turtles come ashore to nest on nearby beaches.</p>
<ul>
<li>Peak nesting: August-November</li>
<li>Guided night tours available</li>
<li>Ostional Wildlife Refuge</li>
<li>Unforgettable experiences</li>
</ul>
</div>
</div>
<div class="season-card">
<div class="season-image festival-season">
<div class="season-overlay">
<h3>Festival Season</h3>
<span>Year Round</span>
</div>
</div>
<div class="season-content">
<h4>Cultural Celebrations</h4>
<p>Experience local culture through vibrant festivals, from religious celebrations to surf competitions and musical events.</p>
<ul>
<li>Nosara Surf Festival (March)</li>
<li>Dia de Guanacaste (July)</li>
<li>Independence Day (September)</li>
<li>Various local celebrations</li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!-- Local Area Section -->
<section id="area" class="area">
<div class="container">
<div class="section-header">
<h2>Discover Nosara</h2>
<p>Your gateway to Costa Rica's most pristine coastline</p>
</div>
<!-- Interactive Map -->
<div class="map-container">
<div id="nosara-map" class="interactive-map"></div>
<div class="map-legend">
<h4>Local Highlights</h4>
<div class="legend-item">
<span class="legend-marker restaurant"></span>
<span>Restaurants</span>
</div>
<div class="legend-item">
<span class="legend-marker hotel"></span>
<span>Hotels</span>
</div>
<div class="legend-item">
<span class="legend-marker beach"></span>
<span>Beaches</span>
</div>
<div class="legend-item">
<span class="legend-marker activity"></span>
<span>Activities</span>
</div>
</div>
</div>
<!-- Local Recommendations -->
<div class="recommendations">
<div class="rec-category">
<h3><i class="fas fa-utensils"></i> Top Restaurants & Bars</h3>
<div class="rec-grid">
<div class="rec-item">
<h4>La Luna</h4>
<p>Beachfront fine dining with Mediterranean-Costa Rican fusion cuisine</p>
<a href="https://www.facebook.com/LaLunaNosara/" target="_blank" rel="noopener noreferrer" class="rec-link">Visit Website →</a>
</div>
<div class="rec-item">
<h4>Olga's Nosara</h4>
<p>Local institution serving fresh seafood and cold Imperial beers</p>
<a href="https://www.instagram.com/olgasnosara/" target="_blank" rel="noopener noreferrer" class="rec-link">Instagram →</a>
</div>
<div class="rec-item">
<h4>Howler's Beach Lounge</h4>
<p>Beachfront bar and restaurant with stunning sunset views</p>
<a href="https://www.instagram.com/howlersbeachlounge/" target="_blank" rel="noopener noreferrer" class="rec-link">Instagram →</a>
</div>
<div class="rec-item">
<h4>Restaurant y Bar Celajes</h4>
<p>Local favorite with authentic Costa Rican cuisine</p>
<a href="https://www.facebook.com/CelajesNosara/" target="_blank" rel="noopener noreferrer" class="rec-link">Facebook →</a>
</div>
<div class="rec-item">
<h4>Elixir</h4>
<p>Fresh juices, smoothies, and healthy bowls</p>
<a href="https://www.instagram.com/elixirnosara/" target="_blank" rel="noopener noreferrer" class="rec-link">Instagram →</a>
</div>
</div>
</div>
<div class="rec-category">
<h3><i class="fas fa-map-marked"></i> Must-Visit Beaches</h3>
<div class="rec-grid">
<div class="rec-item">
<h4>Playa Guiones</h4>
<p>World-class surf break with consistent waves and white sand</p>
<span class="rec-distance">6.5 km</span>
</div>
<div class="rec-item">
<h4>Playa Pelada</h4>
<p>Dramatic rocky coastline perfect for tide pooling</p>
<span class="rec-distance">8.1 km</span>
</div>
<div class="rec-item">
<h4>Playa Ostional</h4>
<p>Protected turtle nesting beach with incredible wildlife</p>
<span class="rec-distance">12.3 km</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Experiences Section -->
<section id="experiences" class="experiences">
<div class="container">
<div class="section-header">
<h2>Unforgettable Experiences</h2>
<p>Discover the adventures waiting for you in Nosara</p>
</div>
<div class="experiences-grid">
<div class="experience-card">
<div class="experience-icon">
<i class="fas fa-water"></i>
</div>
<h3>World-Class Surfing</h3>
<p>Learn to surf at Playa Guiones with professional instructors. Perfect waves for all skill levels.</p>
<div class="experience-links">
<a href="https://nortenosara.com/norte-surf-club/" target="_blank" rel="noopener noreferrer">Norte Surf Club</a>
<a href="https://www.mindfulwaves.com/" target="_blank" rel="noopener noreferrer">Mindful Waves</a>
<a href="https://aguatibia.com/" target="_blank" rel="noopener noreferrer">Agua Tibia</a>
</div>
</div>
<div class="experience-card">
<div class="experience-icon">
<i class="fas fa-ship"></i>
</div>
<h3>Catamaran & Tours</h3>
<p>Sunset cruises, coastal explorations, and adventure tours. Spot dolphins, whales, and enjoy pristine waters.</p>
<div class="experience-links">
<a href="https://www.kayanosara.com/" target="_blank" rel="noopener noreferrer">Kaya Nosara Boat Tours</a>
<a href="https://ticotoursnosara.com/" target="_blank" rel="noopener noreferrer">Tico Tours Nosara</a>
<a href="https://esperanzatourscr.com/tours" target="_blank" rel="noopener noreferrer">Esperanza Tours</a>
</div>
</div>
<div class="experience-card">
<div class="experience-icon">
<i class="fas fa-spa"></i>
</div>
<h3>Yoga & Wellness</h3>
<p>Daily yoga classes and wellness centers. Connect with your inner peace in paradise.</p>
<div class="experience-links">
<a href="https://bodhitreeyogaresort.com/yoga/" target="_blank" rel="noopener noreferrer">Bodhi Tree Yoga</a>
<a href="https://www.nalunosara.com/studio" target="_blank" rel="noopener noreferrer">Nalu Studio</a>
<a href="https://www.nosarablue.com/classes" target="_blank" rel="noopener noreferrer">Nosara Blue</a>
</div>
</div>
<div class="experience-card">
<div class="experience-icon">
<i class="fas fa-hiking"></i>
</div>
<h3>Zipline Adventure</h3>
<p>Soar over 11km of jungle canopy. An unforgettable adrenaline rush through nature.</p>
<div class="experience-links">
<a href="https://www.missskycanopytour.com/" target="_blank" rel="noopener noreferrer">Miss Sky Canopy Tour</a>
</div>
</div>
<div class="experience-card">
<div class="experience-icon">
<i class="fas fa-language"></i>
</div>
<h3>Spanish Classes</h3>
<p>Learn Spanish while immersing yourself in Costa Rican culture with experienced instructors.</p>
<div class="experience-links">
<a href="https://nosaraspanishinstitute.com/" target="_blank" rel="noopener noreferrer">Nosara Spanish Institute</a>
</div>
</div>
<div class="experience-card">
<div class="experience-icon">
<i class="fas fa-leaf"></i>
</div>
<h3>Holistic Wellness</h3>
<p>Natural healing and plant medicine experiences for mind, body, and spirit.</p>
<div class="experience-links">
<a href="https://sacredplantsfarmacy.com/" target="_blank" rel="noopener noreferrer">Sacred Plants Farmacy</a>
<a href="https://www.kambocasita.com/home" target="_blank" rel="noopener noreferrer">Kambo Casita</a>
</div>
</div>
</div>
</div>
</section>
<!-- Costa Rica Video Section -->
<section class="costa-rica-video">
<div class="container">
<div class="section-header">
<h2>Experience Costa Rica</h2>
<p>Discover why Costa Rica is called the happiest place on Earth</p>
</div>
<div class="video-container">
<div class="video-wrapper">
<iframe
src="https://www.youtube.com/embed/LXb3EKWsInQ"
title="Costa Rica - The Ultimate Travel Guide"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
<div class="video-content">
<h3>Pura Vida Paradise</h3>
<p>From pristine beaches to lush rainforests, from volcanic peaks to diverse wildlife, Costa Rica offers an unparalleled natural experience. Nosara sits at the heart of this biodiversity hotspot, where the Pacific Ocean meets protected forests and estuaries.</p>
<ul class="costa-rica-highlights">
<li><i class="fas fa-leaf"></i> 25% of the country is protected parkland</li>
<li><i class="fas fa-paw"></i> Home to 6% of the world's biodiversity</li>
<li><i class="fas fa-dove"></i> Over 900 bird species</li>
<li><i class="fas fa-turtle"></i> Critical sea turtle nesting sites</li>
</ul>
</div>
</div>
</div>
</section>
<!-- History Section -->
<section id="history" class="history">
<div class="container">
<div class="section-header">
<h2>The Rich History of Nosara</h2>
<p>From civil war aftermath to modern paradise - the transformation of Costa Rica's Nicoya Peninsula</p>
</div>
<div class="timeline">
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>1948 - Costa Rican Civil War</h3>
<p>The brief but significant civil war led by José Figueres Ferrer resulted in the abolition of Costa Rica's army. This pivotal moment set the stage for Costa Rica's peaceful future and investment in education and conservation rather than military.</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>1950s-1960s - The Quiet Peninsula</h3>
<p>Post-civil war Nicoya Peninsula remained largely undeveloped, with small fishing communities and cattle ranches. Nosara was accessible only by rough dirt roads, preserving its pristine natural state.</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>1970s - The Swiss Connection</h3>
<p>Swiss investors, enchanted by Nosara's untouched beauty, began purchasing large tracts of land with a vision of sustainable development. They established strict building codes and environmental protections that persist today.</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>1980s - Surf Discovery</h3>
<p>International surfers discovered Playa Guiones' consistent waves. Word spread slowly through the surf community, bringing the first wave of eco-conscious visitors who appreciated the area's commitment to preservation.</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>1990s - Conservation Efforts</h3>
<p>The establishment of Ostional Wildlife Refuge protected critical sea turtle nesting beaches. Local communities became guardians of wildlife, creating a model for conservation-based tourism that benefits both nature and residents.</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>2000s - Yoga & Wellness</h3>
<p>Nosara evolved into a world-renowned wellness destination. The arrival of yoga schools and retreat centers attracted visitors seeking more than just beaches - they came for transformation and connection with nature.</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>2010s-Present - Sustainable Luxury</h3>
<p>Today's Nosara represents the perfect balance of luxury and sustainability. Strict environmental regulations ensure that development respects the natural environment, creating an exclusive destination that preserves its paradise-like qualities.</p>
</div>
</div>
</div>
<div class="history-highlights">
<h3>Cultural Heritage</h3>
<div class="heritage-grid">
<div class="heritage-item">
<i class="fas fa-dove"></i>
<h4>Peace & Stability</h4>
<p>Costa Rica's decision to abolish its military in 1948 created a unique culture of peace that permeates every aspect of life, including tourism.</p>
</div>
<div class="heritage-item">
<i class="fas fa-leaf"></i>
<h4>Environmental Leadership</h4>
<p>From early conservation efforts to modern sustainable tourism, Nosara exemplifies Costa Rica's commitment to environmental protection.</p>
</div>
<div class="heritage-item">
<i class="fas fa-users"></i>
<h4>Community Values</h4>
<p>The blend of Tico (Costa Rican) culture with international influences has created a unique community focused on wellbeing and sustainability.</p>
</div>
<div class="heritage-item">
<i class="fas fa-heart"></i>
<h4>Pura Vida Philosophy</h4>
<p>More than just a saying, "Pura Vida" (pure life) is a way of being that celebrates simplicity, gratitude, and living in harmony with nature.</p>
</div>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="contact">
<div class="container">
<div class="section-header">
<h2>Get in Touch</h2>
<p>Ready to experience the magic of Nosara? Contact Jill directly</p>
</div>
<div class="contact-content">
<div class="contact-info">
<div class="contact-item">
<i class="fas fa-envelope"></i>
<h4>Email</h4>
<p><a href="mailto:jill@nosarabeachfrontrentals.com">jill@nosarabeachfrontrentals.com</a></p>
</div>
<div class="contact-item">
<i class="fab fa-whatsapp"></i>
<h4>WhatsApp</h4>
<p><a href="https://wa.me/13237919091" target="_blank" rel="noopener noreferrer">+1 323 791 9091</a></p>
</div>
<div class="contact-item">
<i class="fas fa-home"></i>
<h4>Reservations</h4>
<p>Book through this website or find us on Airbnb. ID and deposit required.</p>
</div>
</div>
<form class="contact-form" action="https://formspree.io/f/xgvnkdbl" method="POST">
<div class="form-row">
<input type="text" name="name" placeholder="Your Name" required>
<input type="email" name="email" placeholder="Your Email" required>
</div>
<div class="form-row">
<input type="date" name="checkin" placeholder="Check-in" required>
<input type="date" name="checkout" placeholder="Check-out" required>
</div>
<select name="villa" required>
<option value="">Select Villa</option>
<option value="garage">Casita del Garage</option>
<option value="sol">Casita del Sol</option>
<option value="luna">Casita de la Luna</option>
</select>
<textarea name="message" placeholder="Message" rows="5" required></textarea>
<button type="submit" class="btn-primary">Send Inquiry</button>
</form>
</div>
<!-- Find Us Section -->
<div class="find-us">
<div class="section-header">
<h2>Find Us</h2>
<p>Getting to Nosara is a bit of a treasure hunt, and the final stretch to the boca is the dot on the exclamation point</p>
</div>
<!-- Embedded Map -->
<div class="embedded-map">
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d31458.123456789!2d-85.6532!3d9.9759!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x8f9f7a0c9b3d8d8b%3A0x8e8e8e8e8e8e8e8e!2sNosara%2C%20Provincia%20de%20Guanacaste%2C%20Costa%20Rica!5e0!3m2!1sen!2sus!4v1234567890123!5m2!1sen!2sus"
width="100%"
height="450"
style="border:0; border-radius: 15px;"
allowfullscreen=""
loading="lazy"
referrerpolicy="no-referrer-when-downgrade">
</iframe>
</div>
<div class="travel-info">
<div class="travel-overview">
<div class="travel-option">
<i class="fas fa-plane"></i>
<h4>By Air</h4>
<p>Fly from Liberia or San José to Nosara Airport (less than 1 hour)</p>
<a href="https://www.flysansa.com" target="_blank" rel="noopener noreferrer">Book with Sansa →</a>
</div>
<div class="travel-option">
<i class="fas fa-car"></i>
<h4>By Car from Liberia</h4>
<p>Approximately 3 hours drive</p>
</div>
<div class="travel-option">
<i class="fas fa-road"></i>
<h4>By Car from San José</h4>
<p>Approximately 6 hours drive</p>
</div>
</div>
<div class="route-links">
<h4>Driving Directions</h4>
<div class="route-grid">
<a href="https://www.google.com/maps/dir/Liberia,+Costa+Rica/Nosara,+Costa+Rica/@10.2089881,-85.7890625,10z/" target="_blank" rel="noopener noreferrer" class="route-link">
<i class="fas fa-map-marked-alt"></i>
<span>From Liberia (Main Road)</span>
</a>
<a href="https://www.google.com/maps/dir/Liberia,+Costa+Rica/Nosara,+Provincia+de+Guanacaste,+Costa+Rica/@10.3594444,-85.6555556,11z/data=!4m14!4m13!1m5!1m1!1s0x8f757e7c0d4e2a55:0x5b8e29c6c1f8c863!2m2!1d-85.4436021!2d10.6345382!1m5!1m1!1s0x8f9f7b3e6c3e3e3f:0x3e3e3e3e3e3e3e3e!2m2!1d-85.6555556!2d9.9766667!3e0" target="_blank" rel="noopener noreferrer" class="route-link">
<i class="fas fa-water"></i>
<span>From Liberia (Scenic Route - River Crossings)</span>
</a>
<a href="https://www.google.com/maps/dir/San+Jos%C3%A9,+Costa+Rica/Nosara,+Costa+Rica/@9.9766667,-84.8333333,9z/" target="_blank" rel="noopener noreferrer" class="route-link">
<i class="fas fa-mountain"></i>
<span>From San José</span>
</a>
<a href="https://www.google.com/maps/dir/Tilaran,+Costa+Rica/Nosara,+Costa+Rica/@10.4594444,-85.4555556,10z/" target="_blank" rel="noopener noreferrer" class="route-link">
<i class="fas fa-compass"></i>
<span>From Tilarán</span>
</a>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="footer-content">
<div class="footer-section">
<h3>Nosara Beachfront</h3>
<p>Luxury vacation rentals at the mouth of Rio Nosara, where the river meets the Pacific Ocean.</p>
</div>
<div class="footer-section">
<h4>Quick Links</h4>
<ul>
<li><a href="#villas">Our Villas</a></li>
<li><a href="#seasons">Seasons</a></li>
<li><a href="#area">Local Area</a></li>
<li><a href="#history">History</a></li>
</ul>
</div>
<div class="footer-section">
<h4>Contact</h4>
<ul>
<li>info@nosarabeachfront.com</li>
<li>+506 1234-5678</li>
<li>Nosara, Guanacaste</li>
<li>Costa Rica</li>
</ul>
</div>
<div class="footer-section">
<h4>Follow Us</h4>
<div class="social-links">
<a href="#"><i class="fab fa-facebook"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-youtube"></i></a>
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2025 Nosara Beachfront Rentals. All rights reserved.</p>
</div>
</div>
</footer>
<script src="/js/main.js"></script>
</body>
</html>`;
// Create files
const createFiles = () => {
// Write HTML
fs.writeFileSync('index.html', indexHTML);
console.log('✓ Created index.html');
};
// Initialize Express server
const app = express();
const PORT = process.env.PORT || 8200;
// Security headers — added 2026-05-04 (overnight YOLO loop tick 26).
// CSP disabled because the site embeds inline styles + third-party scripts
// (Stripe, fonts, etc.) — defer hardening CSP until each script source is
// catalogued. Other Helmet headers (X-Content-Type-Options, X-Frame-Options
// SAMEORIGIN, Strict-Transport-Security, Referrer-Policy, X-DNS-Prefetch-
// Control, X-Download-Options, X-Permitted-Cross-Domain-Policies) all apply.
const helmet = require('helmet');
app.use(helmet({ contentSecurityPolicy: false }));
// Middleware
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// SECURITY: 404-guard for snapshot/backup paths. Even if a .bak / .pre-* /
// .orig / .rej / .swp / ~ file ever slips into public/ via a sloppy edit,
// it must NEVER be servable over HTTP. Block before static handler runs.
app.use((req, res, next) => {
if (/(\.bak(\.[^/]+)?|\.pre-[^/]+|\.orig|\.rej|\.swp|~)$/i.test(req.path)) {
return res.status(404).send('Not Found');
}
next();
});
app.use(express.static('public'));
// SECURITY: removed `app.use(express.static('.'))` — was exposing .env, server.js, node_modules, etc.
// over HTTP. Anything in project root that needs to be public must move to public/ instead.
// API Routes
const inquiriesRouter = require('./src/routes/inquiries').default;
const propertiesRouter = require('./src/routes/properties').default;
const unsubscribeRouter = require('./src/routes/unsubscribe').default;
app.use('/api', inquiriesRouter);
app.use('/api', propertiesRouter);
app.use('/api', unsubscribeRouter);
// Frontend Route
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
// Setup and start
createProjectStructure();
createFiles();
app.listen(PORT, '0.0.0.0', () => {
console.log(`\n🌴 Nosara Beachfront Rentals Website`);
console.log(`🌊 Server running at http://0.0.0.0:${PORT}`);
console.log(`\n📁 Project structure created`);
console.log(`✨ Ready to view in browser\n`);
});