a Flask like JS router