Skip to content

Commit

Permalink
change route handling
Browse files Browse the repository at this point in the history
  • Loading branch information
craftycram committed Feb 19, 2024
1 parent 7cfef16 commit 5c0f63a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
18 changes: 18 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,24 @@ app.post('/', async (req: Request, res: Response): Promise<void> => {
);
});

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}`);
});
Expand Down

0 comments on commit 5c0f63a

Please sign in to comment.