Skip to content

Commit 2df2b31

Browse files
committed
fix: update documentation to reflect changes in API file for dashboard setup
1 parent 63a97ce commit 2df2b31

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ Now we have to define this endpoint in the backend to make our page work:
305305
306306
307307
308-
Open `index.ts` file and add the following code *BEFORE* `admin.express.serve(` !
308+
Open `api.ts` file and add the following code *BEFORE* `admin.express.authorize` !
309309
310-
```ts title="/index.ts"
310+
```ts title="/api.ts"
311311
312312
import type { IAdminUserExpressRequest } from 'adminforth';
313313
import express from 'express';
@@ -417,11 +417,6 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
417417
)
418418
)
419419
);
420-
421-
// serve after you added all api
422-
admin.express.serve(app)
423-
admin.discoverDatabases();
424-
425420
```
426421
427422
Install and import Zod before using this pattern: `pnpm add zod` or `npm install zod`, then `import * as z from 'zod';`. `admin.express.withSchema(...)` will convert the Zod schema to OpenAPI for you.

0 commit comments

Comments
 (0)