Skip to content

Instantly share code, notes, and snippets.

🎮
Let's make a game

Will Saymon Wyru

🎮
Let's make a game
Block or report user

Report or block Wyru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Wyru
Wyru / routesLoader.js
Created Mar 29, 2020
Dynamically loads routes for express
View routesLoader.js
// Examples
// "routes/get.js" for a get on "/"
// "route/users/get.js" for a get on "/users"
// "route/users/post.js" for a post on "/users"
// "route/users/$id/post.js" for a post on "/users/:id"
import fs from 'fs-readdir-recursive'
import express from 'express'
You can’t perform that action at this time.