mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): build resources (#10958)
This commit is contained in:
parent
04d0f575b7
commit
5f25e2ce82
7 changed files with 38 additions and 25 deletions
|
|
@ -2,8 +2,7 @@ import { Inject, Injectable } from '@nestjs/common';
|
|||
import { Cron, CronExpression, Interval } from '@nestjs/schedule';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { ONE_HOUR, WEB_ROOT } from 'src/constants';
|
||||
import { ONE_HOUR, resourcePaths } from 'src/constants';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { AuthService } from 'src/services/auth.service';
|
||||
import { JobService } from 'src/services/job.service';
|
||||
|
|
@ -56,9 +55,9 @@ export class ApiService {
|
|||
ssr(excludePaths: string[]) {
|
||||
let index = '';
|
||||
try {
|
||||
index = readFileSync(join(WEB_ROOT, 'index.html')).toString();
|
||||
index = readFileSync(resourcePaths.web.indexHtml).toString();
|
||||
} catch {
|
||||
this.logger.warn('Unable to open `www/index.html, skipping SSR.');
|
||||
this.logger.warn(`Unable to open ${resourcePaths.web.indexHtml}, skipping SSR.`);
|
||||
}
|
||||
|
||||
return async (request: Request, res: Response, next: NextFunction) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue