use of io.georocket.http.GeneralEndpoint in project georocket by georocket.
the class GeoRocket method createRouter.
/**
* Create a {@link Router} and add routes for <code>/store/</code>
* to it. Sub-classes may override if they want to add further routes
* @return the created {@link Router}
*/
protected Router createRouter() {
Router router = Router.router(vertx);
Endpoint storeEndpoint = createStoreEndpoint();
router.mountSubRouter("/store", storeEndpoint.createRouter());
Endpoint generalEndpoint = createGeneralEndpoint();
router.mountSubRouter("/", generalEndpoint.createRouter());
router.route().handler(ctx -> {
String reason = "The endpoint " + ctx.request().path() + " does not exist";
ctx.response().setStatusCode(404).end(ServerAPIException.toJson("endpoint_not_found", reason).toString());
});
return router;
}
Aggregations