Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workshop2/issue36 #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Workshop2/issue36 #45

wants to merge 3 commits into from

Conversation

mcarmenjc
Copy link

Added set up instructions for creating a webapi using dotnet cli

@mcarmenjc mcarmenjc added this to the workshop2 milestone Mar 3, 2020
@mcarmenjc mcarmenjc requested a review from a team March 3, 2020 18:24
Comment on lines 46 to 47
`yourname/shelter-backend` (on some teams developers prefix their branch
names with their usernames) or `shelter-backend`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`yourname/shelter-backend` (on some teams developers prefix their branch
names with their usernames) or `shelter-backend`.
`shelter-backend` or `yourname/shelter-backend` (in some teams developers prefix their branch
names with their usernames).

Now we'll use [.NET Core CLI] to create the initial code for our
application:

1. Using your favourite shell, go to the cloned repo location, for example, if you repository was called `happy-rover`, run `cd c:\CodessInTheClassroom\happy-rover` and run the following command to generate a web api project `dotnet new webapi -n backend`. This will create a new C# project with some example code for a weather forecast api, that we will override to create our animal shelter API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Using your favourite shell, go to the cloned repo location, for example, if you repository was called `happy-rover`, run `cd c:\CodessInTheClassroom\happy-rover` and run the following command to generate a web api project `dotnet new webapi -n backend`. This will create a new C# project with some example code for a weather forecast api, that we will override to create our animal shelter API.
1. Using your favourite shell, go to the cloned repo location (for example, if your repository was called `happy-rover`, run `cd c:\CodessInTheClassroom\happy-rover`) and run the following command to generate a web API project: `dotnet new webapi -n backend`. This will create a new C# project with some example code for a weather forecast api, that we will replace to create our animal shelter API.


1. Using your favourite shell, go to the cloned repo location, for example, if you repository was called `happy-rover`, run `cd c:\CodessInTheClassroom\happy-rover` and run the following command to generate a web api project `dotnet new webapi -n backend`. This will create a new C# project with some example code for a weather forecast api, that we will override to create our animal shelter API.
2. Run `code -r c:\CodessInTheClassroom\happy-rover\backend` to open the new created project in Visual Studio Code.
If you're interested in what other options you can pass when creating a project using `.NET Core CLI` , you can [read more here](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is related to the dotnet new command, so I'd move it after point 1 (and maybe format it as a note)

something like this

1. Using your favourite shell, go to the cloned repo location, for example, if you repository was called `happy-rover`, run `cd c:\CodessInTheClassroom\happy-rover` and run the following command to generate a web api project `dotnet new webapi -n backend`. This will create a new C# project with some example code for a weather forecast api, that we will override to create our animal shelter API.
2. Run `code -r c:\CodessInTheClassroom\happy-rover\backend` to open the new created project in Visual Studio Code.
If you're interested in what other options you can pass when creating a project using `.NET Core CLI` , you can [read more here](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new).
3. Let's test now the generated web api, hit `Ctrl+F5` in Visual Studio Code, and it will compile and run the project. If there are no errors, in a browser go to the following URL: [https://localhost:5001/WeatherForecast](https://localhost:5001/WeatherForecast), and the server will return a json document with the weather forecat for the next week.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Let's test now the generated web api, hit `Ctrl+F5` in Visual Studio Code, and it will compile and run the project. If there are no errors, in a browser go to the following URL: [https://localhost:5001/WeatherForecast](https://localhost:5001/WeatherForecast), and the server will return a json document with the weather forecat for the next week.
3. Let's test now the generated web API: hit `Ctrl+F5` in Visual Studio Code, and it will compile and run the project. If there are no errors, open the following URL in a browser: [https://localhost:5001/WeatherForecast](https://localhost:5001/WeatherForecast), and the server will return a JSON document with the weather forecast for the next week.

optionally mention you can do dotnet run from command line as well

We'll commit and push this code to our development branch to have a start point. To do that:
1. [Read the guidance on staging changes and committing in the Git cheatsheet](../git-cheatsheet.md#commit).

For example, you could open a new terminal using `Terminal → New Terminal` and run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(at this point they have already opened a PoSh or cmd prompt, so this might be a bit confusing)

@mcarmenjc mcarmenjc linked an issue Mar 5, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add instructions on how to set up the environment
2 participants