minimal-apis.github.io icon indicating copy to clipboard operation
minimal-apis.github.io copied to clipboard

Routing

Open LadyNaggaga opened this issue 3 years ago • 3 comments

LadyNaggaga avatar Aug 30 '21 20:08 LadyNaggaga

Could we add something like the following to the Basic Routing section on the quick start page?

Keep in mind, once you start assigning specific URL routes such as "/hello", you will need to make sure you are referencing that particular route when running the code.

For example, when clicking the host link http://localhost:5000, you will be met with a "No Webpage Found" if nothing is assigned to the homepage. In order to reference the hello page, you will need to update the link to http://localhost:5000/hello.

DaneeTheDeveloper avatar Oct 01 '21 05:10 DaneeTheDeveloper

Also in subsections 'Route Variables' and 'Constraints', am I supposed to know how to assign variables at that point in the doc?

For example,

app.MapGet("/hello/{name}", (string name) => $"Hello {name}");

Am I supposed to know how to add or change the name value. Like how can I change the name value to David?

DaneeTheDeveloper avatar Oct 01 '21 05:10 DaneeTheDeveloper

We should have an example URL, agree (e.g http://localhost:5000/hello/David)

davidfowl avatar Oct 01 '21 06:10 davidfowl