From 42802bd5438f9ca8ae287971530816e9fbf41b24 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sat, 27 Mar 2021 10:03:20 -0700 Subject: [PATCH] Added mirador route to express server. --- server.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.ts b/server.ts index ada6c9f040..8829fd10be 100644 --- a/server.ts +++ b/server.ts @@ -41,6 +41,8 @@ import { UIServerConfig } from './src/config/ui-server-config.interface'; * Set path for the browser application's dist folder */ const DIST_FOLDER = join(process.cwd(), 'dist/browser'); +// Set path fir IIIF viewer. +const IIIF_VIEWER = join(process.cwd(), 'dist/iiif'); const indexHtml = existsSync(join(DIST_FOLDER, 'index.html')) ? 'index.html' : 'index'; @@ -135,6 +137,10 @@ export function app() { * Serve static resources (images, i18n messages, …) */ server.get('*.*', cacheControl, express.static(DIST_FOLDER, { index: false })); + /* + * Fallthrough to the IIIF viewer (must be included in the build). + */ + server.use('/iiif', express.static(IIIF_VIEWER, {index:false})); // Register the ngApp callback function to handle incoming requests server.get('*', ngApp);