import { handleFcmPush } from './fcmPush.ts'

const port = Number(Deno.env.get('SIDECAR_PORT') ?? '8091')

Deno.serve({ port }, (req: Request) => {
  const url = new URL(req.url)

  if (req.method === 'POST' && url.pathname === '/notify') {
    return handleFcmPush(req)
  }

  return new Response('Not Found', { status: 404 })
})
