• I like the require() idea of @allObjects, to store dynamic pages as modules on the SD card, load them on demand and unload from memory when done. Could be made to be pretty flexible, with the modules exporting properties and methods to be used by the webserver.

    One could even create a dynamic lightweight routing table in memory by loading each of the "route modules" one by one, storing its parameters + a reference to its file (not the callback itself) in the routing table and then unloading the module from memory. On lookup, the server would load the matching route's module, run its callback, and unload it.

    The route modules could live in e.g. /routes for simple automatic retrieval. Their exports object could look something like hapi.js' routing definitions, even having the server support stuff like parameters in path definitions.

About

Avatar for Joakim @Joakim started