1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-08 12:56:48 +01:00
immich/server/src/main.ts

31 lines
802 B
TypeScript
Raw Normal View History

import { bootstrap as admin } from 'src/immich-admin/main';
import { bootstrap as server } from 'src/immich/main';
import { bootstrap as microservices } from 'src/microservices/main';
const immichApp = process.argv[2] || process.env.IMMICH_APP;
if (process.argv[2] === immichApp) {
process.argv.splice(2, 1);
}
function bootstrap() {
switch (immichApp) {
case 'immich': {
2023-08-02 23:03:26 +02:00
process.title = 'immich_server';
return server();
}
case 'microservices': {
2023-08-02 23:03:26 +02:00
process.title = 'immich_microservices';
return microservices();
}
case 'immich-admin': {
2023-08-02 23:03:26 +02:00
process.title = 'immich_admin_cli';
return admin();
}
default: {
throw new Error(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`);
}
}
}
void bootstrap();