Initial work on upload app server

This commit is contained in:
Alan Grainger
2026-10-06 10:07:20 +13:00
parent 9e6c00da35
commit 95ac498cf0
38 changed files with 1493 additions and 40 deletions
+10
View File
@@ -1,6 +1,7 @@
import { NextFunction, Request, Response } from 'express-serve-static-core'
import { resolve } from 'path'
import { getConfigOption } from './config/access'
import { accessible } from './immich/client'
/** Static assets both apps serve from core: pico, the Inter font, the favicon and theme.css. */
export const CORE_PUBLIC_DIR = resolve(__dirname, '../public')
@@ -36,6 +37,15 @@ export function abortOnClose (res: Response): AbortSignal {
return controller.signal
}
/** `GET /healthcheck`: `ok` while Immich answers, else 503. */
export async function healthcheck (_req: Request, res: Response): Promise<void> {
if (await accessible()) {
res.send('ok')
} else {
res.status(503).send()
}
}
/**
* Wrap an async route handler so a rejected promise is passed to Express's
* error chain (and on to `errorHandler`).