- Easier management of all APIs at once.
- Better and organized format for your Endpoints.
- Easy to customize.
- All brackets and things labelled for easier modification.
Edit the config.json
file and fill the contents of it.
port
: The port at which your server will be hosted on.rateLimit
: The time (in ms) in which themaxRequests
option will be initiated.maxRequests
: The maximum number of requests allowed in the set time ofrateLimit
.errorMessage
: The message which will be displayed when the user reached ratelimit on the API.
module.exports = {
name: "Meme", // Name of the API. Not really needed but you can keep it.
url: "/fun/meme", // The url at which the API will be accessable. Eg: https://localhost/fun/meme
run: async(req, res) => {
hdbdbdbdbhd // Enter your code.
}
}