Skip to content

Commit 4d37daa

Browse files
committed
Adding missing comma + using TypeScriptExample
1 parent 11b2f7c commit 4d37daa

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/content/docs/hyperdrive/get-started.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 2
66
---
77

8-
import { Render, PackageManagers, Tabs, TabItem } from "~/components";
8+
import { Render, PackageManagers, Tabs, TabItem, TypeScriptExample } from "~/components";
99

1010
Hyperdrive accelerates access to your existing databases from Cloudflare Workers, making even single-region databases feel globally distributed.
1111

@@ -43,7 +43,7 @@ If you want to skip the steps and get started quickly, click on the button below
4343

4444
**MySQL deployment**
4545

46-
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/docs-examples/tree/hyperdrive-get-started/hyperdrive/hyperdrive-get-started-mysql)
46+
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/mysql-hyperdrive-template)
4747

4848
</TabItem>
4949
</Tabs>
@@ -241,7 +241,8 @@ The `index.ts` file is where you configure your Worker's interactions with Hyper
241241

242242
Populate your `index.ts` file with the following code:
243243

244-
```typescript
244+
<TypeScriptExample>
245+
```ts
245246
// Postgres.js 3.4.5 or later is recommended
246247
import postgres from "postgres";
247248

@@ -284,6 +285,7 @@ export default {
284285
},
285286
} satisfies ExportedHandler<Env>;
286287
```
288+
</TypeScriptExample>
287289

288290
Upon receiving a request, the code above does the following:
289291

@@ -301,7 +303,8 @@ The `index.ts` file is where you configure your Worker's interactions with Hyper
301303

302304
Populate your `index.ts` file with the following code:
303305

304-
```typescript
306+
<TypeScriptExample>
307+
```ts
305308
// mysql2 v3.13.0 or later is required
306309
import { createConnection } from 'mysql2/promise';
307310

@@ -321,7 +324,7 @@ export default {
321324
user: env.HYPERDRIVE.user,
322325
password: env.HYPERDRIVE.password,
323326
database: env.HYPERDRIVE.database,
324-
port: env.HYPERDRIVE.port
327+
port: env.HYPERDRIVE.port,
325328

326329
// The following line is needed for mysql2 compatibility with Workers
327330
// mysql2 uses eval() to optimize result parsing for rows with > 100 columns
@@ -358,6 +361,7 @@ export default {
358361
} satisfies ExportedHandler<Env>;
359362

360363
```
364+
</TypeScriptExample>
361365

362366
Upon receiving a request, the code above does the following:
363367

0 commit comments

Comments
 (0)