diff --git a/src/routes/cron/index.tsx b/src/routes/cron/index.tsx new file mode 100644 index 0000000..2202176 --- /dev/null +++ b/src/routes/cron/index.tsx @@ -0,0 +1,14 @@ +import type { RequestHandler } from '@builder.io/qwik-city' + +export const onRequest: RequestHandler = ({ + headers, + query, + json, + request, +}) => { + console.log('This is the request:', request) + headers.set('Cache-Control', 'private') + if (query.get('format') === 'json') { + json(200, { message: 'Hello World' }) + } +} diff --git a/src/routes/notifications/index.tsx b/src/routes/notifications/index.tsx index 6f20ab2..4cc566e 100644 --- a/src/routes/notifications/index.tsx +++ b/src/routes/notifications/index.tsx @@ -13,7 +13,7 @@ export const onPost = async ({ title: body.title, message: body.message, url: 'https://qwik-calendar.vercel.app/', - icon: 'https://qwik-calendar.vercel.app/home.png', + icon: 'https://qwik-calendar.vercel.app/logo.png', }) const response = await fetch('https://api.pushalert.co/rest/v1/send', { diff --git a/vercel.json b/vercel.json index 9e9a00b..a83f62c 100644 --- a/vercel.json +++ b/vercel.json @@ -9,5 +9,11 @@ } ] } + ], + "crons": [ + { + "path": "/cron", + "schedule": "0 0 * * *" + } ] }