2023-08-01 22:07:52 +00:00
|
|
|
import { bootstrap as adminCli } from './admin-cli/main';
|
2023-06-08 15:01:07 +00:00
|
|
|
import { bootstrap as immich } from './immich/main';
|
|
|
|
import { bootstrap as microservices } from './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 21:03:26 +00:00
|
|
|
process.title = 'immich_server';
|
2023-06-08 15:01:07 +00:00
|
|
|
return immich();
|
|
|
|
case 'microservices':
|
2023-08-02 21:03:26 +00:00
|
|
|
process.title = 'immich_microservices';
|
2023-06-08 15:01:07 +00:00
|
|
|
return microservices();
|
2023-08-01 22:07:52 +00:00
|
|
|
case 'admin-cli':
|
2023-08-02 21:03:26 +00:00
|
|
|
process.title = 'immich_admin_cli';
|
2023-08-01 22:07:52 +00:00
|
|
|
return adminCli();
|
2023-06-08 15:01:07 +00:00
|
|
|
default:
|
|
|
|
console.log(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
}
|
2023-10-13 05:22:40 +00:00
|
|
|
void bootstrap();
|