42 lines
1.4 KiB
Java
Executable File
42 lines
1.4 KiB
Java
Executable File
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package tech.iresponse;
|
|
|
|
import tech.iresponse.core.Application;
|
|
import tech.iresponse.exceptions.DatabaseException;
|
|
import tech.iresponse.http.Response;
|
|
import tech.iresponse.logging.Loggers;
|
|
import tech.iresponse.orm.Database;
|
|
import tech.iresponse.utils.MapError;
|
|
|
|
public class Bootstrap {
|
|
public static void main(String[] params) {
|
|
try {
|
|
try {
|
|
if (params.length != 1) {
|
|
throw new DatabaseException("No arguments passed to our service !");
|
|
}
|
|
Application app = new Application();
|
|
app.ini();
|
|
Database.init();
|
|
app.setSystemDatabaseProcessId(Integer.parseInt(Database.getBackendPid("system")));
|
|
app.setClientsDatabaseProcessId(Integer.parseInt(Database.getBackendPid("clients")));
|
|
app.checkEndpoint(params[0]);
|
|
app.getInstanceApplication();
|
|
MapError.ini(app.controller());
|
|
}
|
|
catch (Throwable t) {
|
|
String str = t instanceof DatabaseException ? t.getMessage() : "Internal server error !";
|
|
MapError.ini(new Response(str, 500));
|
|
Loggers.error(t);
|
|
Application.deleteFille();
|
|
}
|
|
}
|
|
finally {
|
|
Application.deleteFille();
|
|
}
|
|
}
|
|
}
|
|
|