Skip to content

Commit 2ec24ed

Browse files
committed
edits
1 parent 7f4f366 commit 2ec24ed

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

articles/typespec/includes/quickstart/file-structure-typescript.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ms.custom: devx-track-ts, devx-track-typespec
33
ms.topic: include
44
ms.date: 04/23/2025
55
---
6-
The project structure for the generated server includes the Express.js server, the package.json, and the middleware for your Azure integration.
6+
The Express.js project structure found at `tsp-output/server/` includes the generated server, the package.json, and the middleware for your Azure integration.
77

88
```console
99
├── docs
@@ -13,4 +13,15 @@ The project structure for the generated server includes the Express.js server, t
1313
├── README.md
1414
├── package.json
1515
├── openapi3.json
16+
```
17+
18+
The file structure for the parent TypeSpec project includes this Express.js project in `tsp-output`:
19+
20+
```console
21+
├── tsp-output
22+
├── .gitignore
23+
├── main.tsp
24+
├── package-lock.json
25+
├── package.json
26+
├── tspconfig.yaml
1627
```

articles/typespec/quickstart-scaffold-dotnet.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,27 @@ Create the files needed to have a repeatable deployment with [Azure Developer CL
10121012
...bicep..
10131013
```
10141014

1015+
## Project structure
1016+
1017+
The final project structure includes the TypeSpec API files, the Express.js server, and the Azure deployment files:
1018+
1019+
```console
1020+
├── infra
1021+
├── tsp-output
1022+
├── .gitignore
1023+
├── .azure.yaml
1024+
├── Dockerfile
1025+
├── main.tsp
1026+
├── package-lock.json
1027+
├── package.json
1028+
├── tspconfig.yaml
1029+
```
1030+
1031+
| Area | Files/Directories |
1032+
|--------------------------|-----------------------------------------------------------------------------------|
1033+
| **TypeSpec** | `main.tsp`, `tspconfig.yaml` |
1034+
| **Express.js server** | `./tsp-output/server/` (includes generated files like `controllers/`, `models/`, `ServiceProject.csproj`) |
1035+
| **Azure Developer CLI deployment** | `./azure.yaml`,`./infra/` |
10151036

10161037
## Deploy application to Azure
10171038

articles/typespec/quickstart-scaffold-typescript.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Quickstart: Create a new TypeScript API project with TypeSpec"
3-
description: Learn how to generate and set up a new RESTful TypeScrip API project using TypeSpec to scaffold consistent client and server code for cloud services.
3+
description: Learn how to generate and set up a new RESTful TypeScript API project using TypeSpec to scaffold consistent client and server code for cloud services.
44
ms.topic: quickstart
55
ms.date: 04/30/2025
66
ms.custom: devx-track-typespec, devx-track-js, devx-track-ts
@@ -110,7 +110,7 @@ TypeSpec defines your API in a language-agnostic way and generates the API serve
110110
1. TypeSpec generates the default project in `./tsp-output`, creating two separate folders:
111111

112112
* **schema** is the OpenApi 3 specification. Notice that the few lines in `./main.tsp` generated over 200 lines of OpenApi specification for you.
113-
* **server** is the generated middleware. This can be incorporated into a Node.js server project.
113+
* **server** is the generated middleware. This middleware can be incorporated into a Node.js server project.
114114
* `./tsp-output/js/src/generated/models/all/demo-service.ts` defines the interfaces for the Widgets API.
115115
* `./tsp-output/js/src/generated/http/openapi3.ts` defines the Open API spec as a TypeScript file and is regenerated every time you compile your TypeSpec project.
116116
@@ -147,7 +147,7 @@ Use the TypeSpec files to configure the API server generation to scaffold the en
147147
npx hsjs-scaffold
148148
```
149149

150-
1. Change into the new `/./tsp-output/server` directory:
150+
1. Change into the new `./tsp-output/server` directory:
151151

152152
```console
153153
cd ./tsp-output/server
@@ -179,7 +179,7 @@ Use the TypeSpec files to configure the API server generation to scaffold the en
179179

180180
## Change persistence to Azure Cosmos DB no-sql
181181

182-
Now that the basic Express.js API server is working, update the Express.js server to work with [Azure Cosmos DB](/azure/cosmos-db/) for a persistent data store. This includes changes to the `index.ts` to use Cosmos DB integration in the middleware. All changes should happen outside the `./src/generated` directory.
182+
Now that the basic Express.js API server is working, update the Express.js server to work with [Azure Cosmos DB](/azure/cosmos-db/) for a persistent data store. This includes changes to the `index.ts` to use Cosmos DB integration in the middleware. All changes should happen outside the `./tsp-output/server/src/generated` directory.
183183

184184
1. In the `./tsp-output/server` directory, add [Azure Cosmos DB](/azure/cosmos-db/) to the project:
185185

@@ -287,9 +287,9 @@ Now that the basic Express.js API server is working, update the Express.js serve
287287
};
288288
```
289289

290-
Notice the file uses the endpoint, database, and container. It doesn't need a connection string or key because it is using the Azure Identity credential `DefaultAzureCredential`. Learn more about this method of [secure authentication for both local and production](/azure/developer/javascript/sdk/authentication/overview) environments.
290+
Notice the file uses the endpoint, database, and container. It doesn't need a connection string or key because it's using the Azure Identity credential `DefaultAzureCredential`. Learn more about this method of [secure authentication for both local and production](/azure/developer/javascript/sdk/authentication/overview) environments.
291291

292-
1. Create a new Widget controller, `./src/controllers/widgets-cosmos.ts`, with the following code to integrate Azure Cosmos DB.
292+
1. Create a new Widget controller, `./tsp-output/server/src/controllers/widgets-cosmos.ts`, and paste in the following integration code for Azure Cosmos DB.
293293

294294
```typescript
295295
import { Widgets, Widget, WidgetList, AnalyzeResult,Error } from "../generated/models/all/demo-service.js";
@@ -504,7 +504,7 @@ Now that the basic Express.js API server is working, update the Express.js serve
504504
}
505505
```
506506

507-
1. Update the `./src/index.ts` to use the new controller.
507+
1. Update the `./tsp-output/server/src/index.ts` to use the new controller.
508508

509509
```typescript
510510
// Generated by Microsoft TypeSpec
@@ -930,7 +930,7 @@ Once deployed, you can:
930930
Now that you have the entire end to end process working, continue to build your API:
931931

932932
* Learn more about the [TypeSpec language](https://typespec.io/docs/language-basics/overview/) to add more APIs and API layer features in the `./main.tsp`.
933-
* Add additional [emitters](https://typespec.io/docs/extending-typespec/emitters-basics/) and configure their parameters in the `./tspconfig.yaml`.
933+
* Add more [emitters](https://typespec.io/docs/extending-typespec/emitters-basics/) and configure their parameters in the `./tspconfig.yaml`.
934934
* As you add more features in your TypeSpec files, support those changes with source code in the server project.
935935
* Continue to use [passwordless authentication](/azure/developer/javascript/sdk/authentication/overview) with Azure Identity.
936936

0 commit comments

Comments
 (0)