diff --git a/package.json b/package.json index 4a9bec6..3ecea85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blaze", - "version": "1.0.0", + "version": "2.0.1", "description": "blazing fast ci/cd. small rest api service to receive ghcr event hooks to update services running in a dockerized portainer instance", "main": "index.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index f81197b..6d996cc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -186,6 +186,24 @@ app.post('/', async (req: Request, res: Response): Promise => { ); }); +app.get('/', (_req: Request, res: Response): void => { + res.status(200).json({ + msg: 'Hi this is Blaze. Ready to receive webhooks. Find out more about Blaze on GitHub.', + url: 'https://github.com/itmr-dev/blaze', + time: new Date().toISOString(), + uptime: process.uptime(), + logo: 'https://raw.githubusercontent.com/itmr-dev/blaze/main/assets/blaze.png', + version: '2.0.1', + }); +}); + +app.use((_req: Request, res: Response): void => { + res.status(400).json({ + msg: 'Hi this is Blaze. Ready to receive webhooks.', + error: 'page not found', + }); +}); + app.listen(process.env.PORT || 80, (): void => { console.log(`ready to receive webhooks on port ${process.env.PORT || 80}`); });