Skip to content

Instantly share code, notes, and snippets.

Let's make a game

Will Saymon Wyru

Let's make a game
View GitHub Profile
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.