How to apply stripe texture along a curved mesh?
Try using a wave generator set to use the Z axis of the object to power your color ramp.
I was able to get the following result by creating a curve, converting it to a mesh, and using the following node setup:

I've also used a Vector Math node to offset the pattern start, else the pink takes up more than it's fair share. Try adjusting the OFFSET input, as well as the Wave texture scale attribute.