varexpress=require('express'),app=express(),path=require('path');vargatekeep=require('gate-keep');gatekeep.setprivilege(path.join(__dirname,'privilege.yaml'));//pass absolute path to .yaml allowed/blocked fileapp.use(gatekeep.white.privilege);//Allows only the specified IP Address in privilege.yaml `whitelist` section// Other configurations include// app.use(gatekeep.black.privilege); Allows access to all IP Addresses except those listed in privilege.yaml `blacklist` section/**************** * Other stuff ** ****************/// gate-keep passes a `err` to next() when the IP is restricted so you // need to define an error handler to catch itapp.use(function(err,req,res,next){res.status(403);res.send('Denied');});app.listen(3000);