2024-03-20 19:32:04 +01:00
|
|
|
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';
|
2023-06-08 17:01:07 +02:00
|
|
|
|
|
|
|
const immichApp = process.argv[2] || process.env.IMMICH_APP;
|
|
|
|
|
|
|
|
if (process.argv[2] === immichApp) {
|
|
|
|
process.argv.splice(2, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
function bootstrap() {
|
|
|
|
switch (immichApp) {
|
2024-02-02 04:18:00 +01:00
|
|
|
case 'immich': {
|
2023-08-02 23:03:26 +02:00
|
|
|
process.title = 'immich_server';
|
2023-11-30 21:59:47 +01:00
|
|
|
return server();
|
2024-02-02 04:18:00 +01:00
|
|
|
}
|
|
|
|
case 'microservices': {
|
2023-08-02 23:03:26 +02:00
|
|
|
process.title = 'immich_microservices';
|
2023-06-08 17:01:07 +02:00
|
|
|
return microservices();
|
2024-02-02 04:18:00 +01:00
|
|
|
}
|
|
|
|
case 'immich-admin': {
|
2023-08-02 23:03:26 +02:00
|
|
|
process.title = 'immich_admin_cli';
|
2023-11-30 21:59:47 +01:00
|
|
|
return admin();
|
2024-02-02 04:18:00 +01:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
throw new Error(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`);
|
|
|
|
}
|
2023-06-08 17:01:07 +02:00
|
|
|
}
|
|
|
|
}
|
2023-10-13 07:22:40 +02:00
|
|
|
void bootstrap();
|