12 new API endpoints
Build and Deploy / build (push) Successful in 1m44s
Build Release / build (push) Successful in 58s
Build and Deploy / deploy (push) Successful in 26s

This commit is contained in:
2026-06-16 20:51:18 +02:00
parent 5be3d127bb
commit 19c477aa05
26 changed files with 867 additions and 455 deletions
+25
View File
@@ -0,0 +1,25 @@
const express = require('express');
const router = express.Router();
function isSorted(arr) {
for (let i = 1; i < arr.length; i++) {
if (arr[i] < arr[i - 1]) return false;
}
return true;
}
router.post('/', (req, res) => {
const { input } = req.body;
if (!Array.isArray(input)) {
return res.status(400).json({ error: 'input must be an array' });
}
if (isSorted(input)) {
res.json({ ret: input, miracle: true, message: 'A miracle has occurred!' });
} else {
res.json({ ret: input, miracle: false, message: 'Waiting for cosmic miracle... Please try again later.' });
}
});
module.exports = router;