package lc.ris.svc;

import lc.esp.engine.ESPEngine;
import lc.mecha.fabric.HandlerStatus;
import lc.mecha.http.server.HttpTransaction;
import lc.mecha.http.server.PrefixedHandler;

import java.nio.charset.StandardCharsets;
import java.util.Set;

public class RapidInventoryService {
    public static void main(String[] args) throws Exception {
        ESPEngine esp = new ESPEngine();
        esp.register(new PrefixedHandler(Set.of("/")) {
            @Override
            public HandlerStatus handlePrefixedWebRequest(HttpTransaction request) throws Throwable {
                request.httpServletResponse.getOutputStream().write("Hello World".getBytes(StandardCharsets.UTF_8));
                return HandlerStatus.BREAK;
            }
        });
        esp.runDangerously();
    }
}
