cleanup serve_font.js
Co-Authored-By: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
c7377e82d5
commit
2e74bc7b4a
1 changed files with 8 additions and 2 deletions
|
@ -4,7 +4,13 @@ import express from 'express';
|
||||||
|
|
||||||
import { getFontsPbf, listFonts } from './utils.js';
|
import { getFontsPbf, listFonts } from './utils.js';
|
||||||
|
|
||||||
export const serve_font = async (options, allowedFonts) => {
|
/**
|
||||||
|
* Initializes and returns an Express app that serves font files.
|
||||||
|
* @param {object} options - Configuration options for the server.
|
||||||
|
* @param {object} allowedFonts - An object containing allowed fonts.
|
||||||
|
* @returns {Promise<express.Application>} - A promise that resolves to the Express app.
|
||||||
|
*/
|
||||||
|
export async function serve_font(options, allowedFonts) {
|
||||||
const app = express().disable('x-powered-by');
|
const app = express().disable('x-powered-by');
|
||||||
|
|
||||||
const lastModified = new Date().toUTCString();
|
const lastModified = new Date().toUTCString();
|
||||||
|
@ -45,4 +51,4 @@ export const serve_font = async (options, allowedFonts) => {
|
||||||
const fonts = await listFonts(options.paths.fonts);
|
const fonts = await listFonts(options.paths.fonts);
|
||||||
Object.assign(existingFonts, fonts);
|
Object.assign(existingFonts, fonts);
|
||||||
return app;
|
return app;
|
||||||
};
|
}
|
||||||
|
|
Loading…
Reference in a new issue