mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: allow unordered migrations in dev (#19881)
This commit is contained in:
parent
a625921e8f
commit
1cc5ca14ca
4 changed files with 8 additions and 4 deletions
|
|
@ -7,7 +7,6 @@ import { existsSync } from 'node:fs';
|
|||
import sirv from 'sirv';
|
||||
import { ApiModule } from 'src/app.module';
|
||||
import { excludePaths, serverVersion } from 'src/constants';
|
||||
import { ImmichEnvironment } from 'src/enum';
|
||||
import { WebSocketAdapter } from 'src/middleware/websocket.adapter';
|
||||
import { ConfigRepository } from 'src/repositories/config.repository';
|
||||
import { LoggingRepository } from 'src/repositories/logging.repository';
|
||||
|
|
@ -27,7 +26,6 @@ async function bootstrap() {
|
|||
const configRepository = app.get(ConfigRepository);
|
||||
|
||||
const { environment, host, port, resourcePaths } = configRepository.getEnv();
|
||||
const isDev = environment === ImmichEnvironment.DEVELOPMENT;
|
||||
|
||||
logger.setContext('Bootstrap');
|
||||
app.useLogger(logger);
|
||||
|
|
@ -35,11 +33,11 @@ async function bootstrap() {
|
|||
app.set('etag', 'strong');
|
||||
app.use(cookieParser());
|
||||
app.use(json({ limit: '10mb' }));
|
||||
if (isDev) {
|
||||
if (configRepository.isDev()) {
|
||||
app.enableCors();
|
||||
}
|
||||
app.useWebSocketAdapter(new WebSocketAdapter(app));
|
||||
useSwagger(app, { write: isDev });
|
||||
useSwagger(app, { write: configRepository.isDev() });
|
||||
|
||||
app.setGlobalPrefix('api', { exclude: excludePaths });
|
||||
if (existsSync(resourcePaths.web.root)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue