Update index.js
Browse files363 unmodified lines364365366367368369367368369370371122 unmodified lines494495496498497498500499500501502363 unmodified lines }, { "title": "Mega Downloader", "method": "POST", "example": `${host}/mega`, "body": "JSON.stringify({ \"url\": \"example.com\" })" "method": "GET", "example": `${host}/mega?url=`+ '${encodeURIComponent(${url})}', } ] });122 unmodified lines return res.json({ message: e.message }); } }); app.post('/mega', async (req, res) => { app.get('/mega', async (req, res) => { try { let { url } = req.body; let { url } = req.query; if (!/https:\/\/mega\.nz\/file\/[a-zA-Z0-9]{8}#[a-zA-Z0-9-_]{43}/.test(url)) { return res.json({ message: 'Invalid URL' }); }index.js+4-5