https://github.com/sefinek/express-favicon
Favicon middleware for Express.js with additional headers responsible for caching the icon in the client's browser.
https://github.com/sefinek/express-favicon
express express-favicon express-js express-middleware favicon server-favicon
Last synced: about 1 month ago
JSON representation
Favicon middleware for Express.js with additional headers responsible for caching the icon in the client's browser.
- Host: GitHub
- URL: https://github.com/sefinek/express-favicon
- Owner: sefinek
- License: mit
- Created: 2023-11-01T07:54:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-12T23:07:47.000Z (about 1 year ago)
- Last Synced: 2024-12-22T05:56:12.209Z (4 months ago)
- Topics: express, express-favicon, express-js, express-middleware, favicon, server-favicon
- Language: JavaScript
- Homepage: https://npmjs.com/package/@sefinek/express-favicon
- Size: 61.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @sefinek/express-favicon
Favicon middleware for [Express.js](https://github.com/expressjs/express) with [additional headers](https://github.com/sefinek24/express-favicon/blob/2b7bee22e84750b3de01448c2ec1d70b3d074aed/index.js#L25) responsible for caching the icon in the client's browser.## Installation
```bash
npm install @sefinek/express-favicon
```## Usage
```js
const express = require('express');
const favicon = require('@sefinek/express-favicon');const app = express();
app.use(favicon(__dirname + '/public/favicon.png'));app.get('/', (req, res) => {
res.send('Hello World!
');
});app.listen(8080, () => {
console.log('Example app is ready!');
});
```## Example icon
## MIT License
Copyright 2023-2024 © by [Sefinek](https://sefinek.net). All Rights Reserved.