Ring spec middleware utility for javascript