ktor-routing

Generate Ktor routing, StatusPages, and JWT authentication scaffolds.

1|1|Updated Apr 9, 2024
One-click install
npx skills add https://github.com/navikt/helved-utbetaling --skill ktor-routing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ktor-routing
Source: https://github.com/navikt/helved-utbetaling/tree/main/.agents/skills/ktor-routing
Command: npx skills add https://github.com/navikt/helved-utbetaling --skill ktor-routing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes and accelerates building Ktor routing, StatusPages, and JWT-based authentication by providing ready-to-use patterns that align with helved-utbetaling conventions.

Core Features & Use Cases

  • Predefined Route extensions and wiring for Application modules.
  • Centralized StatusPages/ApiError handling and JWT authentication blocks.
  • Quick integration with existing app wiring for consistent behavior across services.

Quick Start

Create a new route under Route extensions, wire it into an Application module, and protect it with an authenticate block.

Frequently Asked Questions about ktor-routing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce boilerplate when building Ktor routing and JWT authentication in Kotlin?

To reduce boilerplate in Ktor routing and JWT authentication, use standardized extension route functions and predefined authentication blocks. This provides ready-to-use scaffolds for REST endpoints, ensuring consistent behavior across web applications without repetitive setup code.

What is the best way to standardize StatusPages and APIError handling in a Ktor web application?

The best way to standardize StatusPages and APIError handling in a Ktor web application is through centralized configuration blocks. This enforces consistent error responses across services, reducing boilerplate while integrating with existing app wiring for uniform behavior.

Can I use extension route functions to wire new REST endpoints into an existing Ktor Application module?

Yes, you can use extension route functions to wire new REST endpoints into an existing Ktor Application module. This pattern aligns with Kotlin conventions, enabling quick integration with app wiring and ensuring consistent behavior across services without modifying core setup.

How do I protect Ktor routes with JWT-based access control?

To protect Ktor routes with JWT-based access control, wrap your route extensions in an authenticate block. This predefined scaffold enforces standardized authentication patterns, reducing boilerplate while ensuring consistent access control behavior across applications.

Does this Ktor routing scaffold work with the helved-utbetaling system conventions?

Yes, this Ktor routing scaffold is specifically designed to work with helved-utbetaling system conventions. It enforces Kotlin and Ktor patterns through predefined route extensions, StatusPages handling, and JWT authentication blocks, ensuring consistent behavior across apps.