caas
Description
Solution
(async () => {
await new Promise(r => window.addEventListener('load', r));
document.querySelector('code').textContent =
`${window.origin}/cowsay/{message}`;
})();app.get('/cowsay/:message', (req, res) => {
exec(`/usr/games/cowsay ${req.params.message}`, {timeout: 5000}, (error, stdout) => {
if (error) return res.status(500).end();
res.type('txt').send(stdout).end();
});
});Last updated