Upgrade to cashu-ts v4 and drop unused deps.
Adapt amount handling for v4 Amount objects, replace axios/uuid with fetch and crypto.randomUUID, and remove dead helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,18 +33,6 @@ app.use(cors({
|
||||
optionsSuccessStatus: 200
|
||||
}));
|
||||
|
||||
// Additional middleware for Swagger UI preflight requests
|
||||
app.use((req, res, next) => {
|
||||
if (req.method === 'OPTIONS') {
|
||||
res.header('Access-Control-Allow-Origin', '*');
|
||||
res.header('Access-Control-Allow-Methods', 'GET', 'POST', 'OPTIONS');
|
||||
res.header('Access-Control-Allow-Headers', 'Content-Type', 'Authorization', 'Accept', 'Origin', 'X-Requested-With');
|
||||
res.status(200).end();
|
||||
return;
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
// Debug endpoint to test CORS
|
||||
app.get('/api/cors-test', (req, res) => {
|
||||
res.json({
|
||||
@@ -93,7 +81,7 @@ const rateLimitMap = new Map();
|
||||
const RATE_LIMIT = parseInt(process.env.RATE_LIMIT) || 100;
|
||||
|
||||
function rateLimit(req, res, next) {
|
||||
const clientId = req.ip || req.connection.remoteAddress;
|
||||
const clientId = req.ip || req.socket.remoteAddress;
|
||||
const now = Date.now();
|
||||
const windowStart = now - 60000;
|
||||
|
||||
@@ -159,7 +147,7 @@ app.use('/api', lightningRoutes);
|
||||
app.use('/api', healthRoutes);
|
||||
|
||||
// 404 handler
|
||||
app.use('*', (req, res) => {
|
||||
app.use((req, res) => {
|
||||
res.status(404).json({
|
||||
success: false,
|
||||
error: 'Endpoint not found'
|
||||
|
||||
Reference in New Issue
Block a user