1.0.3 • Published 3 years ago

@tycrek/express-nofavicon v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

NoFavicon

Tiny Express middleware that sends HTTP 204 "No Content" for Favicon requests

Usage

This package is installable from GitHub Packages. To use this package in your project, create an .npmrc file in the same directory as your project's package.json file with these contents:

@tycrek:registry=https://npm.pkg.github.com

Now, install with npm i @tycrek/express-nofavicon and use as a middleware:

const nofavicon = require('@tycrek/express-nofavicon');
const express = require('express');

const app = express();
app.use(nofavicon);

What is it doing?

If the request URL (req.url) matches (using regex test) /favicon.ico, the response will be HTTP 204 No Content.