Skip to content

Commit

Permalink
fix docs highlighting (#1743)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuskohlberg authored Jan 28, 2025
1 parent b089f6e commit 4208118
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/go/tutorials/rest-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ CREATE TABLE url (
🥐 Next, go back to the `url/url.go` file and import the `encore.dev/storage/sqldb` package by modifying the import statement to become:

```go
-- url/url.go --
HL url/url.go 5:5
-- url/url.go --
import (
"context"
"crypto/rand"
Expand Down
10 changes: 5 additions & 5 deletions docs/ts/tutorials/rest-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ CREATE TABLE url (
🥐 Next, go back to the `url/url.ts` file and import the `SQLDatabase` class from `encore.dev/storage/sqldb` module by modifying the imports to look like this:

```ts
-- url/url.ts --
HL url/url.ts 1:1
-- url/url.ts --
import { api } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
import { randomBytes } from "node:crypto";
Expand All @@ -162,8 +162,8 @@ import { randomBytes } from "node:crypto";
🥐 Now, to define the database, create an instance of the `SQLDatabase` class in the `url` service:

```ts
-- url/url.ts --
HL url/url.ts 4:5
-- url/url.ts --
import { api } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
import { randomBytes } from "node:crypto";
Expand Down Expand Up @@ -193,8 +193,8 @@ export const shorten = api(
🥐 Lastly, update the `shorten` function to insert data into the database:

```ts
-- url/url.ts --
HL url/url.ts 21:24
-- url/url.ts --
import { api } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
import { randomBytes } from "node:crypto";
Expand Down Expand Up @@ -267,9 +267,9 @@ To complete our URL shortener API, let’s add the endpoint to retrieve a URL gi
🥐 Add this endpoint to `url/url.ts`:

```ts
-- url/url.ts --
HL url/url.ts 0:0
HL url/url.ts 29:39
-- url/url.ts --
import { api, APIError } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
import { randomBytes } from "node:crypto";
Expand Down Expand Up @@ -352,8 +352,8 @@ $ npm i --save-dev vitest
🥐 Next we need to add a test script to our `package.json`:

```json
-- package.json --
HL package.json 1:1
-- package.json --
"scripts": {
"test": "vitest"
},
Expand Down
4 changes: 2 additions & 2 deletions docs/ts/tutorials/slack-bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ Let's define a secret using Encore's secrets management functionality.
🥐 Add this to your `slack.ts` file:

```ts
-- slack/slack.ts --
HL slack/slack.ts 0:0
HL slack/slack.ts 2:2
-- slack/slack.ts --
import { secret } from "encore.dev/config";
const slackSigningSecret = secret("SlackSigningSecret");
Expand Down Expand Up @@ -265,8 +265,8 @@ We're now ready to verify the signature.
🥐 Update the `cowsay` function to look like this:

```ts
-- slack/slack.ts --
HL slack/slack.ts 5:12
-- slack/slack.ts --
export const cowsay = api.raw(
{ expose: true, path: "/cowsay", method: "*" },
async (req, resp) => {
Expand Down

0 comments on commit 4208118

Please sign in to comment.