// This app is mostly single threaded. It handles all requests and state changes on a single thread.
// Speed should ideally not be an issue, as the backend blocks only rarely. If it's a problem then
// we'll have to split the backend thread from the http server thread.
AffinityExecutor.ServiceAffinityExecutor executor = new AffinityExecutor.ServiceAffinityExecutor("server");
server.setExecutor(executor);
LighthouseBackend backend = new LighthouseBackend(SERVER, kit.peerGroup(), kit.chain(), (PledgingWallet) kit.wallet(), executor);
backend.setMinPeersForUTXOQuery(minPeersSupportingGetUTXO);
server.createContext(LHUtils.HTTP_PATH_PREFIX, new ProjectHandler(backend));
server.createContext("/", exchange -> {
log.warn("404 Not Found: {}", exchange.getRequestURI());
exchange.sendResponseHeaders(404, -1);