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