This module allows you to use a favicon.ico
in your Appwrite Functions with AppExpress
.
The favicon.ico
is saved in memory after the first request until the function container is removed.
Here's a Live Demo for reference!
Add the middleware like this -
npm install @itznotabug/appexpress-favicon
// import
import AppExpress from '@itznotabug/appexpress';
import favIcon from '@itznotabug/appexpress-favicon';
// setup
const express = new AppExpress();
// if you serve static content &
// the favicon is in public dir then exclude favicon explicitly.
express.static('public', ['favicon.ico']);
express.middleware(favIcon({ iconPath: 'icons/favicon.ico', maxCacheDays: 30 }));