Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Details

nodemon runs server continuously

npm install nodemon
  "scripts": {
    "start": "nodemon server.js"
  }

RATE LIMITER

npm i express-rate-limit

import rateLimit from "express-rate-limit";

const app = express();
let limiter = rateLimit({
  max:3,      // number of max attemp
  windowMs: 60*60*1000, // 1 hour in milisecond
  message: "we have received too many requests from this API. Please try again after one hour"
})

app.use('/books', limiter); //rate limiter will be applied to the  all API starts with /books 

Helmet.js to secure HTTP Headers

npm i helmet

import helmet from "helmet";

const app = express();

app.use(helmet());

app.use(express.json({limit: '10kb'}));
 // add this limit to the response.
// more than 10kb will be truncated

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages