Your weapon for defeating the boss is a bow and (infinite) supply of arrows, you simply left click and the bow will fire an arrow towards where the mouse pointer is.
The worm itself will aim itself at your head and proceed to charge at you, before arcing back down into the ground. Whilst in the air it will launch projectiles and, based on the angle it comes out at, use a powerful spray attack.
You should probably focus most on dodging it's body