Exploring Crystal macros: Building file-based routing for Kemal 0 ▲ Wilson Tovar (krthr) 299 days ago · Tecnología · ocultar I have two go-to technologies for my personal projects: Crystal and Nuxt. I love Nuxt for how easy it is to spin up a full-stack server and the incredible Developer Experience (DX) it provides. On the other hand, I love Crystal for its simplicity and raw speed. As I dove deeper into Crystal, I found myself wondering: Is it possible to have file-based routing like in Nuxt (powered by Nitro)? So, I decided to build it myself. To replicate this behavior in Crystal, I broke the problem down into three main challenges: Discovery: Reading the file tree to find route definitions. Importing: Dynamically importing the handlers for each route. Registration: Constructing the routes and serving them via an HTTP server. The Challenge: Dynamic ImportsI knew from the start that the biggest hurdle would be importing code dynamically. In JavaScript, it is trivial to traverse a directory and import or require files on the fly. But in Crystal? Since it is a compiled language, I can’t simply "require" a… Bubbles ya no tiene comentarios. ¿Por qué? Si quieres hablar de esta publicación, escríbele a quien la escribió, usa los comentarios de su blog si los tiene, o responde con una entrada "RE:" en tu propio blog. ¿Sugerencias? feedback@bubbles.town