UNPKG

allah

Version:

ciddi değildir

18 lines (16 loc) 551 B
const fetch = require('node-fetch') module.exports = { sureler: async() => { const api = await fetch(`https://api.acikkuran.com/surahs`) .then(response => response.json()); if(api.error) throw 'CodAre apisi ile bağlantı sağlanamadı' return api }, sure: async function(id) { if(!id || isNaN(id)) throw 'düzgün id belirt' const api = await fetch(`https://api.acikkuran.com/surah/${id}`) .then(response => response.json()); if(api.error) throw 'CodAre apisi ile bağlantı sağlanamadı' return api } }