mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 21:29:00 +00:00

Look, this will make the git history look funny, but trimming unnecessary depth from the source tree is a very necessary sanity-preserving measure when dealing with a super-modularized codebase like this one. While it makes the project configuration a bit less conventional, it will save you several clicks every time you jump between modules. Which you'll do a lot, because it's *modul*ar. The src/main/java convention makes a lot of sense for a non-modular project though. This ain't that.
40 lines
1.1 KiB
Java
40 lines
1.1 KiB
Java
package nu.marginalia.search;
|
|
|
|
import com.google.inject.Guice;
|
|
import com.google.inject.Inject;
|
|
import com.google.inject.Injector;
|
|
import nu.marginalia.service.MainClass;
|
|
import nu.marginalia.service.ServiceDiscoveryModule;
|
|
import nu.marginalia.service.id.ServiceId;
|
|
import nu.marginalia.service.module.ServiceConfigurationModule;
|
|
import nu.marginalia.service.module.DatabaseModule;
|
|
import nu.marginalia.service.server.Initialization;
|
|
import spark.Spark;
|
|
|
|
public class SearchMain extends MainClass {
|
|
private final SearchService service;
|
|
|
|
@Inject
|
|
public SearchMain(SearchService service) {
|
|
this.service = service;
|
|
}
|
|
|
|
public static void main(String... args) {
|
|
|
|
init(ServiceId.Search, args);
|
|
|
|
Spark.staticFileLocation("/static/search/");
|
|
|
|
Injector injector = Guice.createInjector(
|
|
new SearchModule(),
|
|
new ServiceConfigurationModule(ServiceId.Search),
|
|
new ServiceDiscoveryModule(),
|
|
new DatabaseModule(false)
|
|
);
|
|
|
|
injector.getInstance(SearchMain.class);
|
|
injector.getInstance(Initialization.class).setReady();
|
|
|
|
}
|
|
}
|