A simple and beginner friendly api template built in nodejs and expressjs. Rate limite system included
Downdload the files, install nodejs on your computer ( nodejs.org ) and run it with node app.js
If you need any help, join this server: discord.gg/Q5QSbAHaXB
You can customize the settings in the config.js
in the line 5 .
For the rate limite system, 4 req/s is a good value depening on the use you want to make of this.
You can create new routes by creating a file in the routes
folder. Example route:
const { Router } = require('express');
module.exports.Router = class Home extends Router {
constructor() {
super();
this.get('/', async function(req, res) {
res.status(200).send("Hello")
});
this.post('/', async function(req, res) {
console.log("Got a post request");
});
}
};
module.exports.name = '/test';