code organize
routable middleware: detect whether a request should be handled by router
fix: avoid store null into database setEnvironment