Skip to content

Commit

Permalink
#391 First draft for programatical route configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
svenkubiak committed Sep 24, 2018
1 parent 8833be7 commit 996df57
Show file tree
Hide file tree
Showing 39 changed files with 792 additions and 1,092 deletions.
18 changes: 6 additions & 12 deletions mangooio-core/src/main/java/io/mangoo/admin/AdminController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.LongAdder;
import java.util.stream.Collectors;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -26,7 +24,6 @@

import com.google.inject.Inject;

import io.mangoo.annotations.FilterWith;
import io.mangoo.cache.Cache;
import io.mangoo.configuration.Config;
import io.mangoo.core.Application;
Expand All @@ -40,8 +37,6 @@
import io.mangoo.models.Metrics;
import io.mangoo.providers.CacheProvider;
import io.mangoo.routing.Response;
import io.mangoo.routing.Route;
import io.mangoo.routing.Router;
import io.mangoo.routing.bindings.Request;
import io.mangoo.scheduler.Scheduler;
import io.mangoo.utils.BootstrapUtils;
Expand All @@ -53,7 +48,6 @@
* @author svenkubiak
*
*/
@FilterWith(AdminFilter.class)
public class AdminController {
private static final org.apache.logging.log4j.Logger LOG = LogManager.getLogger(AdminController.class);
private static final String JOBS = "jobs";
Expand Down Expand Up @@ -176,15 +170,15 @@ public Response metrics() {
}

public Response routes() {
Set<Route> routes = Router.getRoutes()
.stream()
.filter((Route route) -> !route.getUrl().contains("@admin"))
.collect(Collectors.toSet());

// Set<Route> routes = Router.getRoutes()
// .stream()
// .filter((Route route) -> !route.getUrl().contains("@admin"))
// .collect(Collectors.toSet());
//
return Response.withOk()
.andContent(SPACE, ROUTES)
.andContent(VERSION, VERSION_TAG)
.andContent(ROUTES, routes)
//.andContent(ROUTES, routes)
.andTemplate(Template.DEFAULT.routesPath());
}

Expand Down
81 changes: 0 additions & 81 deletions mangooio-core/src/main/java/io/mangoo/admin/AdminFilter.java

This file was deleted.

Loading

0 comments on commit 996df57

Please sign in to comment.