Software Alternatives & Reviews

How filesystem-based routers work: building one for express

Fastify ExpressJS
  1. Fastify is a low overhead web framework, for Node.js.
    Pricing:
    • Open Source
    This is the simplest way to make a file-based router in express js. This logic can obviously be translated to be used in other framework, like this plugin for fastify.

    #Web Frameworks #Developer Tools #JavaScript Framework 21 social mentions

  2. Sinatra inspired web development framework for node.js -- insanely fast, flexible, and simple
    Pricing:
    • Open Source
    Have you ever wondered how Next, Sveltekit, Nuxt (even Expo now) do their routing? What's the magic that makes it so when you create a file called +page.svelte in a directory called routes, just for it to magically works? Well, wonder no more! I'll show you how to build your own file-based router for express in Javascript, though the concepts we'll see are usable in other frameworks and other languages. This article will focus on parsing files, ignoring folders (because that is a whole of grenades I'm not yet ready to step - and write - on). Let's get to it!

    #JavaScript Framework #Node.js Framework #Web Frameworks 425 social mentions

Discuss: How filesystem-based routers work: building one for express

Log in or Post with