gadingnst / quran-api

Simple Quran API & Database with Indonesia Tafsir and media audio (murrotal) Syekh. Mishary Rashid Alafasy
https://api.quran.gading.dev
MIT License
756 stars 210 forks source link

Add option to disable rate limit #33

Closed Khuirul-Huda closed 2 years ago

Khuirul-Huda commented 2 years ago

Everything was working fine before, but after some recent commits (feat/mongo-rate-limiter) an error occurred

500: INTERNAL_SERVER_ERROR Code: FUNCTION_INVOCATION_FAILED

[GET] /
11:32:29:67
2022-06-11T04:32:31.186Z    undefined   ERROR   Error: collection or collectionName and uri should be set
    at new MongoStore (/var/task/node_modules/rate-limit-mongo/lib/mongoStore.js:28:9)
    at Object.<anonymous> (/var/task/api/server.js:29:12)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:192:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async getListener (/var/task/___vc/__launcher.js:37:11)
RequestId: c53c5a9b-29c3-4259-a563-f78fb6e***** Error: Runtime exited with error: exit status 1
Runtime.ExitError

The error turned out to be from the rate-limit feature, because I deploy it on my own instance I don't think I need this rate-limit feature. It would be great if there was an option for disable this rate limit. maybe from Environment Variables?

Thank you!

gadingnst commented 2 years ago

Solved at https://github.com/gadingnst/quran-api/pull/35 @Khuirul-Huda