You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/app-service-web-tutorial-rest-api.md
+47-49Lines changed: 47 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: 'Tutorial: Host RESTful API with CORS'
3
-
description: Learn how Azure App Service helps you host your RESTful APIs with CORS support. App Service can host both front-end web apps and backend APIs.
2
+
title: 'Tutorial: Host a RESTful API with CORS'
3
+
description: Learn how Azure App Service helps you host your RESTful APIs with CORS support. App Service can host both front-end web apps and back-end APIs.
4
4
ms.assetid: a820e400-06af-4852-8627-12b3db4a8e70
5
5
ms.devlang: csharp
6
6
ms.topic: tutorial
@@ -12,42 +12,40 @@ author: msangapu-msft
12
12
13
13
# Tutorial: Host a RESTful API with CORS in Azure App Service
14
14
15
-
[Azure App Service](overview.md) provides a highly scalable, self-patching web hosting service. In addition, App Service has built-in support for [Cross-Origin Resource Sharing (CORS)](https://wikipedia.org/wiki/Cross-Origin_Resource_Sharing) for RESTful APIs. This tutorial shows how to deploy an ASP.NET Core API app to App Service with CORS support. You configure the app using command-line tools and deploy the app using Git.
15
+
[Azure App Service](overview.md) provides a highly scalable self-patching web hosting service. In addition, App Service has built-in support for [cross-origin resource sharing (CORS)](https://wikipedia.org/wiki/Cross-Origin_Resource_Sharing) for RESTful APIs. This tutorial shows how to deploy an ASP.NET Core API app to App Service with CORS support. You configure the app using command-line tools and deploy the app using Git.
16
16
17
17
In this tutorial, you learn how to:
18
18
19
19
> [!div class="checklist"]
20
-
> * Create App Service resources using Azure CLI
21
-
> * Deploy a RESTful API to Azure using Git
22
-
> * Enable App Service CORS support
20
+
> * Create App Service resources using Azure CLI.
21
+
> * Deploy a RESTful API to Azure using Git.
22
+
> * Enable App Service CORS support.
23
23
24
-
You can follow the steps in this tutorial on macOS, Linux, Windows.
24
+
You can complete this tutorial on macOS, Linux, or Windows.
This repository contains an app that's created based on the following tutorial: [ASP.NET Core Web API help pages using Swagger](/aspnet/core/tutorials/web-api-help-pages-using-swagger?tabs=visual-studio). It uses a Swagger generator to serve the [Swagger UI](https://swagger.io/swagger-ui/) and the Swagger JSON endpoint.
48
+
This repository contains an app that's created based on the tutorial [ASP.NET Core Web API help pages using Swagger](/aspnet/core/tutorials/web-api-help-pages-using-swagger?tabs=visual-studio). It uses a Swagger generator to serve the [Swagger UI](https://swagger.io/swagger-ui/) and the Swagger JSON endpoint.
51
49
52
50
1. Make sure the default branch is `main`.
53
51
@@ -56,7 +54,7 @@ In this step, you set up the local ASP.NET Core project. App Service supports th
56
54
```
57
55
58
56
> [!TIP]
59
-
> The branch name change isn't required by App Service. However, since many repositories are changing their default branch to `main` (see [Change deployment branch](deploy-local-git.md#change-deployment-branch)), this tutorial also shows you how to deploy a repository from `main`.
57
+
> The branch name change isn't required by App Service. However, since many repositories are changing their default branch to `main` (see [Change deployment branch](deploy-local-git.md#change-deployment-branch)), this tutorial shows you how to deploy a repository from `main`.
60
58
61
59
### Run the application
62
60
@@ -67,23 +65,23 @@ In this step, you set up the local ASP.NET Core project. App Service supports th
67
65
dotnet run
68
66
```
69
67
70
-
1. Navigate to `http://localhost:5000/swagger`in a browser to play with the Swagger UI.
68
+
1. Navigate to `http://localhost:5000/swagger`in a browser to try the Swagger UI.
71
69
72
-

70
+

73
71
74
-
1. Navigate to `http://localhost:5000/api/todo`and see a list of ToDo JSON items.
72
+
1. Navigate to `http://localhost:5000/api/todo`to see a list of ToDo JSON items.
75
73
76
-
1. Navigate to `http://localhost:5000` and play with the browser app. Later, you will point the browser app to a remote API in App Service to test CORS functionality. Code forthe browser app is foundin the repository's _wwwroot_ directory.
74
+
1. Navigate to `http://localhost:5000` and experiment with the browser app. Later, you'll point the browser app to a remote API in App Service to test CORS functionality. Code for the browser app is found in the repository's _wwwroot_ directory.
77
75
78
-
1. To stop ASP.NET Core at any time, press `Ctrl+C` in the terminal.
76
+
1. To stop ASP.NET Core at any time, select**Ctrl+C**in the terminal.
0 commit comments