@modern-js/server-core
Version:
A Progressive React Framework for modern web development.
21 lines (20 loc) • 416 B
JavaScript
const faviconPlugin = () => ({
name: "@modern-js/plugin-favicon",
setup(api) {
return {
prepare() {
const { middlewares } = api.useAppContext();
middlewares.push({
name: "favicon-fallback",
path: "/favicon.ico",
handler: async (c, _next) => {
return c.body(null, 204);
}
});
}
};
}
});
export {
faviconPlugin
};