How to exactly use "wrangler publish" because the tutorial seems outdated

https://egghead.io/lessons/cloudflare-set-up-a-new-cloudflare-workers-project-with-wrangler Hi there so I was following this tutorial and in this they use the command wrangler publish but when I do so on my terminal I get the error
Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler publish path/to/script`) or the `main` config field.
Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler publish path/to/script`) or the `main` config field.
Do I just need to do something like wrangler publish index.js ?
egghead
Set up a New Cloudflare Workers Project with wrangler
In this lesson, we'll install Wrangler, the Workers command-line tool. We'll then create a new Cloudflare Workers project using Wrangler, configure it, and then publish it.
7 Replies
James
James2y ago
That course is pretty old now and uses wrangler 1, so things have changed. You'll want to use Wrangler 2 via wrangler, instead of @cloudflare/wrangler, and then specify a main in your wrangler.toml
James
James2y ago
Get started guide · Cloudflare Workers docs
This guide will instruct you through setting up a Cloudflare account to deploying your first Worker. This guide assumes that you already have a …
zinzu
zinzuOP2y ago
oh thanks @cherryjimbo also unrelated but any idea what is wrong with
curl -H "Content-type: application/json" -d '{"query": "guitar"}' http://127.0.0.1:8787/
curl -H "Content-type: application/json" -d '{"query": "guitar"}' http://127.0.0.1:8787/
zinzu
zinzuOP2y ago
James
James2y ago
curl in Windows is... different curl is an alias to Invoke-WebRequest in Windows Powershell, with very different syntax
zinzu
zinzuOP2y ago
oh... F
Erisa
Erisa2y ago
Windows does include real curl as well though, you can swap out curl for curl.exe in the command and it should be better
Want results from more Discord servers?
Add your server