diff --git a/docs/ts/tutorials/rest-api.mdx b/docs/ts/tutorials/rest-api.mdx index 950bf0dd92..641efcaeb7 100644 --- a/docs/ts/tutorials/rest-api.mdx +++ b/docs/ts/tutorials/rest-api.mdx @@ -152,7 +152,6 @@ 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 -HL url/url.ts 1:1 -- url/url.ts -- import { api } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; @@ -162,7 +161,7 @@ import { randomBytes } from "node:crypto"; πŸ₯ Now, to define the database, create an instance of the `SQLDatabase` class in the `url` service: ```ts -HL url/url.ts 4:5 +HL url/url.ts 4:6 -- url/url.ts -- import { api } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; @@ -193,7 +192,7 @@ export const shorten = api( πŸ₯ Lastly, update the `shorten` function to insert data into the database: ```ts -HL url/url.ts 21:24 +HL url/url.ts 21:26 -- url/url.ts -- import { api } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; @@ -267,8 +266,8 @@ To complete our URL shortener API, let’s add the endpoint to retrieve a URL gi πŸ₯ Add this endpoint to `url/url.ts`: ```ts -HL url/url.ts 0:0 -HL url/url.ts 29:39 +HL url/url.ts 0:1 +HL url/url.ts 29:40 -- url/url.ts -- import { api, APIError } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; @@ -352,7 +351,6 @@ $ npm i --save-dev vitest πŸ₯ Next we need to add a test script to our `package.json`: ```json -HL package.json 1:1 -- package.json -- "scripts": { "test": "vitest"