Javascript routing with syntax similar to Laravel PHP framework