use of io.kamax.mxgwd.model.Gateway in project mxgwd by kamax-io.
the class UndertowApp method main.
public static void main(String[] args) throws IOException {
String cfgFile = StringUtils.defaultIfBlank(System.getenv("MXGWD_CONFIG_FILE"), "mxgwd.yaml");
Config cfg = Value.get(YamlConfigLoader.loadFromFile(cfgFile), Config::new);
Gateway gw = new Gateway(cfg);
CatchAllHandler allHandler = new CatchAllHandler(gw);
ActivePoliciesListingHandler activePolicies = new ActivePoliciesListingHandler(gw);
Undertow server = Undertow.builder().addHttpListener(cfg.getServer().getPort(), "0.0.0.0").setHandler(Handlers.path().addExactPath("/_matrix/client/r0/policy/policies", activePolicies).addPrefixPath("/", allHandler)).build();
server.start();
}