simplified serve function with node url module and switch