docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a simple URL shortener redirect service using Koa that handles URL-encoded redirect targets.
The service should:
GET /r/:target where :target is a URL-encoded redirect destination/**
* Creates and returns a configured Koa application instance with redirect routing.
*
* @returns {Application} A Koa application instance
*/
function createApp() {
// IMPLEMENTATION HERE
}
module.exports = { createApp };/r/https%3A%2F%2Fexample.com, the service redirects to https://example.com with status 302 @test/r/https%3A%2F%2Fgithub.com%2Fkoajs%2Fkoa, the service redirects to https://github.com/koajs/koa with status 302 @test/r/https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%2520world, the service redirects to https://example.com/search?q=hello%20world with status 302 @testProvides routing with URL parameter decoding support.
Provides the web application framework.