This commit is contained in:
Emily
2025-04-16 17:13:19 +02:00
parent 946f9d4d32
commit f631c29fb2
12 changed files with 59 additions and 60 deletions

View File

@@ -17,11 +17,23 @@ console.log('Stripe started in', STRIPE_TESTMODE ? 'TESTMODE' : 'LIVEMODE');
const app = express();
const TOKEN = process.env.TOKEN;
if (!TOKEN || TOKEN.length == 0) {
console.log('TOKEN not set');
process.exit();
}
app.use((req, res, next) => {
const token = req.header('x-litlyx-token');
if (token != TOKEN) {
res.status(403).json({ error: 'token not valid' });
return;
}
console.log(req.path);
next();
})
});
app.use('/webhook', webhookRouter);
app.use('/payment', paymentRouter);