---
title: "RouteGroup"
sidebar_label: "RouteGroup"
description: "Kotlin binding reference: RouteGroup."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[RouteGroup](index.md)

# RouteGroup

[common]\
class [RouteGroup](index.md)

A group of routes under a path prefix, with its own middleware; made by [HttpServer.group](../HttpServer/group.md) or [group](group.md). `AutoCloseable`: [close](close.md) releases the group's handle (the routes registered stay on the server).

## Functions

| Name | Summary |
|---|---|
| [close](close.md) | [common]<br>open fun [close](close.md)() |
| [get](get.md) | [common]<br>fun [get](get.md)(path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), handler: [Handler](../Handler/index.md)): [RouteGroup](index.md)<br>A GET route. |
| [group](group.md) | [common]<br>fun [group](group.md)(prefix: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [RouteGroup](index.md)<br>A nested group under a further prefix. |
| [post](post.md) | [common]<br>fun [post](post.md)(path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), handler: [Handler](../Handler/index.md)): [RouteGroup](index.md)<br>A POST route. |
| [route](route.md) | [common]<br>fun [route](route.md)(method: [Method](../Method/index.md), path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), handler: [Handler](../Handler/index.md)): [RouteGroup](index.md)<br>Register [handler](route.md) for [method](route.md) at the exact [path](route.md). |
| [routePattern](routePattern.md) | [common]<br>fun [routePattern](routePattern.md)(method: [Method](../Method/index.md), pattern: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), handler: [Handler](../Handler/index.md)): [RouteGroup](index.md)<br>Register [handler](routePattern.md) for [method](routePattern.md) at a path [pattern](routePattern.md) (a regular expression; its groups are the captures). |
| [use](use.md) | [common]<br>fun [use](use.md)(middleware: [Middleware](../Middleware/index.md)): [RouteGroup](index.md)<br>Add a middleware to every route of this group. |