From 2e74bc7b4ac03c299a34d6ff72af7ec57c1e9e3e Mon Sep 17 00:00:00 2001 From: acalcutt Date: Sun, 29 Dec 2024 02:34:39 -0500 Subject: [PATCH] cleanup serve_font.js Co-Authored-By: Andrew Calcutt --- src/serve_font.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/serve_font.js b/src/serve_font.js index d753905..30f1fc8 100644 --- a/src/serve_font.js +++ b/src/serve_font.js @@ -4,7 +4,13 @@ import express from 'express'; 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} - A promise that resolves to the Express app. + */ +export async function serve_font(options, allowedFonts) { const app = express().disable('x-powered-by'); const lastModified = new Date().toUTCString(); @@ -45,4 +51,4 @@ export const serve_font = async (options, allowedFonts) => { const fonts = await listFonts(options.paths.fonts); Object.assign(existingFonts, fonts); return app; -}; +}