Astro Public My Restaurant Script Link [top] (2027)

<!-- Inside the <body> of index.astro --> <section> <h3>Find Us</h3> <iframe src="https://www.google.com/maps/embed?pb=!1m18..." width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" ></iframe> </section> <!-- Example: External script link for a reservation widget --> <script is:inline src="https://app.opentable.com/widget/reservation/loader.js"></script> The is:inline attribute in Astro prevents the framework from bundling/optimizing the script, which is exactly what you want for a third-party widget. Part 2: Making Your Astro Restaurant Page Public Once your page is built, you need to make it public (accessible via URL). Here is how you get that “public my restaurant” link. Option A: Deploy to Vercel (One-Click & Free) npm run build # Then install Vercel CLI or connect your GitHub repo to vercel.com Vercel will give you a public URL like: https://my-restaurant.vercel.app – that is your public link. Option B: Deploy to Netlify (Drag & Drop) Run npm run build . The output is in the dist/ folder. Drag that folder into Netlify’s web interface. You’ll get a public link: https://your-restaurant.netlify.app . Option C: Deploy to Cloudflare Pages or GitHub Pages All of these provide instant public .com or .app domains.

Create a .env file:

export async function GET() const menu = items: [ name: "Pizza", price: 12 , name: "Salad", price: 8 ] ; return new Response(JSON.stringify(menu), headers: "Content-Type": "application/json" ); astro public my restaurant script link

src/pages/api/menu.json.js

(function() fetch('/api/menu.json') .then(res => res.json()) .then(data => const container = document.getElementById('restaurant-menu'); if(container) container.innerHTML = data.items.map(item => `<li>$item.name - $$item.price</li>`).join(''); ); )(); Copy and paste this into any website to display your public restaurant menu: Option A: Deploy to Vercel (One-Click & Free)