This commit is contained in:
21
src/index.ts
Normal file
21
src/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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}`);
|
||||
});
|
||||
Reference in New Issue
Block a user