Files
tiny-webhook/src/index.ts
Cauê Faleiros c687fd2bd1
Some checks failed
Build and Deploy / build-and-push (push) Failing after 4m14s
first commit
2026-04-09 09:45:02 -03:00

22 lines
611 B
TypeScript

import express, { Express, Request, Response } from 'express';
import dotenv from 'dotenv';
import webhookRoutes from './routes/webhook.route';
dotenv.config();
const app: Express = express();
const port = process.env.PORT || 3000;
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use('/api/webhooks', webhookRoutes);
app.get('/health', (req: Request, res: Response) => {
res.status(200).json({ status: 'OK', message: 'Tiny-n8n middleware is running.' });
});
app.listen(port, () => {
console.log(`[server]: Middleware server is running at http://localhost:${port}`);
});