import { FastifyInstance } from 'fastify' ; import { syncProducts , syncPrices } from '../lib/sync' ; export default async function routes ( server ) { /**
     * POST /products/sync
     *    Sync products from Stripe
     */ server . post ( '/sync' , { handler : async ( request , reply ) => { const products = await syncProducts ( ) ; const prices = await syncPrices ( ) ; return reply . send ( { statusCode : 200 , ts : Date . now ( ) , products , prices } ) ; } } ) ; }