Cloudflare API - Upload Worker


I’m trying to upload a worker via the Cloudflare API but I’m struggling to get it to work. I keep getting back an error saying my script has an unexpected token. The documentation makes it seem pretty straightforward forward but I’m stuck. Any help would be appreciated!

My Code