Initial commit: Vuelato - buscador de vuelos
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Nuxt 4 + Supabase + Flightics API. Incluye búsqueda de vuelos, inspiraciones, watchlist, tracking de precios y mapa interactivo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
14
server/api/airlines.get.ts
Normal file
14
server/api/airlines.get.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { serverSupabaseServiceRole } from '#supabase/server'
|
||||
|
||||
export default defineCachedEventHandler(async (event) => {
|
||||
const supabase = serverSupabaseServiceRole(event)
|
||||
|
||||
const { data, error } = await supabase
|
||||
.from('airlines')
|
||||
.select('iata, icao, name, logo_url, website, booking_url, booking_url_template')
|
||||
.order('name')
|
||||
|
||||
if (error) throw createError({ statusCode: 500, message: error.message })
|
||||
|
||||
return { airlines: data }
|
||||
}, { maxAge: 60 * 60 * 24 }) // cache 24h
|
||||
Reference in New Issue
Block a user