Skip to content

Commit

Permalink
docs: added Kotlin code examples in routeoverview.md (#270)
Browse files Browse the repository at this point in the history
* feat: added `Kotlin` code examples in routeoverview.md

* fix: format of code
  • Loading branch information
Shawoll committed Jun 30, 2024
1 parent 8a5617f commit 6ccc42e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pages/plugins/routeoverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ If the clients accepts JSON, this is served as JSON. Otherwise it's served as HT

You can enable the route-overview either through the `config.plugins` or by registering it manually:

```java
{% capture java %}
Javalin.create(config -> {
config.plugins.enableRouteOverview(path); // show all routes on specified path
config.plugins.enableRouteOverview(path, roles); // show all routes on specified path (with auth)
config.plugins.register(new RouteOverviewPlugin(path)); // show all routes on specified path
config.plugins.register(new RouteOverviewPlugin(path, roles)); // show all routes on specified path (with auth)
});
```
{% endcapture %}
{% capture kotlin %}
Javalin.create { config ->
config.plugins.enableRouteOverview(path) // show all routes on specified path
config.plugins.enableRouteOverview(path, roles) // show all routes on specified path (with auth)
config.plugins.register(RouteOverviewPlugin(path)) // show all routes on specified path
config.plugins.register(RouteOverviewPlugin(path, roles)) // show all routes on specified path (with auth)
}}
{% endcapture %}
{% include macros/docsSnippet.html java=java kotlin=kotlin %}

0 comments on commit 6ccc42e

Please sign in to comment.