supercharge/framework

Load route files only once during bootstrapping

Closed this issue · 0 comments

When starting a Supercharge app, the framework will bootstrap the HTTP server and load route files from your app/routes directory. Therefore, it at first checks whether you have any route in your app and in case you do, it registers them to the server.

Currently, route files are loaded from disk whenever requested.

The idea of this task is to store the route files in a class property and load them only once.

Tasks

  • cache loaded route files in a class property
  • return route files from the cache and only load them when needed

affected file: load-routes.js bootstrapper