
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
mini-route-loader
Advanced tools
Route file configuration for express
See the unit test for implementation instructions
import MiniRouteLoader from 'mini-route-loader'
import APIController from '../controllers/APIController'
const Routes = JSON.parse( fs.readFileSync('./server/routes/routes.json') )
this.apiController=new APIController( )
const app = express()
MiniRouteLoader.loadRoutes( app, Routes , this.apiController )
app.listen(apiPort, () => {
console.log(`API Server listening at http://localhost:${apiPort}`)
})
Type: A string, either 'get' or 'post' for the type of REST request to expect
uri: The uri onto which to expose the route with express
method: The name of the controller method to call (the method must extend APICall
controller: The name of the controller that has the methods for this route
appendParams: An object that will be appended to 'req' just before it is passed to the method in the controller. This will be appended at 'req.router.params'
[ {"type":"get","uri":"/api/ping","method":"ping","controller":"api"}
]
import { APICall } from "mini-route-loader"
export default class APIController {
ping: APICall = async (req: any, res: any) => {
return res.status(200).send('Pong')
}
}
FAQs
Load routes to controllers for Express
We found that mini-route-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.