BTC — ETH — ICP — SOL — LIVE · updates every 60s
LedgerLifeICP · BITCOIN · DEFI · WEB3
← LedgerLife Devhub

Rust Library Brings File-Based Routing to Internet Computer Canisters

By Maria Irene · 28 Feb 2026

A new open-source Rust library aims to simplify how developers build and deploy web applications on the Internet Computer Protocol, offering a familiar routing structure while keeping everything fully on-chain.

Developer Kristofer Lund has released ic-asset-router v0.1.1, a personal project designed to introduce file-based HTTP routing to Internet Computer (ICP) canisters. Inspired by frameworks such as Next.js and SvelteKit, the library allows developers to create certified web endpoints by placing handler files directly into a routes directory, removing much of the manual setup traditionally required for ICP applications.

The release arrives as developers continue exploring ways to build full-stack applications entirely on-chain, where both front-end delivery and backend logic operate within a single canister. According to Lund, the project grew out of practical frustrations faced while building React single-page applications on ICP, particularly around search engine visibility and social media previews.

Single-page applications typically return identical HTML across all routes, which prevents crawlers from generating accurate previews or metadata. The new library addresses this limitation by dynamically generating route-specific index.html files at the canister level, embedding customised meta tags and Open Graph images while allowing the application to function normally in the browser.

This approach enables developers to maintain a standard SPA experience while improving discoverability without relying on external servers or off-chain rendering services.

Beyond search optimisation, ic-asset-router attempts to reduce boilerplate code associated with ICP HTTP handlers. Tasks such as routing logic, response certification, cache handling, and endpoint wiring are automated, allowing developers to focus on application features rather than infrastructure setup. Each file placed inside the src/routes directory automatically becomes an endpoint during compilation, with typed parameters and middleware applied through a structured hierarchy.

The library supports multiple certification modes, including authenticated responses designed to prevent cached data from being shared between users. Developers can selectively disable certification for endpoints such as health checks, which may benefit from faster query-style execution.

Middleware functionality mirrors patterns common in modern web frameworks. A middleware file placed within a directory wraps all nested routes, enabling developers to manage tasks such as CORS handling or security headers with minimal configuration.

A working example of the system is already live through the Promptathon Showcase application, which uses a single canister to serve both a React front end and a JSON API. The setup resembles a traditional full-stack framework, except the application runs entirely on-chain after being compiled to WebAssembly.

The project includes ten deployable examples ranging from server-rendered HTML templates to authenticated APIs and cache invalidation workflows, offering developers reference implementations for common use cases.

Lund said the library was largely developed using an AI coding agent guided by the “RALPH loop” workflow, a structured development process introduced by Geoffrey Huntley that breaks projects into tightly scoped tasks executed sequentially. Documentation outlining the method, prompts, and development specifications has been published alongside the codebase.

While ic-asset-router is not an official DFINITY release, it reflects a growing trend of independent tooling emerging around the Internet Computer ecosystem as developers experiment with new ways to host applications without traditional cloud infrastructure.

Early feedback will likely determine whether the library becomes a broader standard within the ICP developer community, particularly among teams seeking simpler deployment patterns without sacrificing on-chain guarantees. Contributions and issue reports are currently being accepted through the project’s public repository.