public static void main(String... args) { HttpProtocolConfiguration http = new HttpProtocolConfiguration(); //re-write all requests to /app/* to index.html http.getTranscriber().addTranscription(new Transcription("/app((?:\\/[\\w([^\\..]{1,4}\b)\\-]+)+)", "/index.html")); HiggsServer server = new HiggsServer().setConfig("config.yml", HttpConfig.class); server.registerProtocol(http); // server.registerPackage(Api.class.getPackage()); // server.registerClass(Api.class); // server.registerObject(new Api()); server.start(); } }
protocolConfig.getTranscriber().transcribe(request);
public static void main(String... args) { //handles HTTP GET requests WebSocketConfiguration ws = new WebSocketConfiguration(); //handles all other HTTP requests HttpProtocolConfiguration http = new HttpProtocolConfiguration(); //re-write all requests to /app/* to index.html ws.getTranscriber().addTranscription(new Transcription("/app((?:\\/[\\w([^\\..]{1,4}\b)\\-]+)+)", "/index.html")); HiggsServer server = new HiggsServer().setConfig("config.yml", HttpConfig.class); server.registerProtocol(ws); //HTTP must be registered after WebSockets server.registerProtocol(http); // server.registerClass(Api.class); server.start(); } }