this is a middleware of Express.js.it is used filter image request by depending config.it must be in front of express.static server.
npm install express-image-filter
npm i express-image-filterimport express from 'express';
import filterImg from 'express-image-filter';
const app = express();
app.use(filterImg({
blockNotImg: true,
allowHost: ['localhost:5000'],
},express.static('./file')));
type config = {
allowHost?: string[],
blockNotImg?: boolean,
}
``