Generic router for js apps