Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ Now we have to define this endpoint in the backend to make our page work:



Open `index.ts` file and add the following code *BEFORE* `admin.express.serve(` !
Open `api.ts` file and add the following code *BEFORE* `admin.express.authorize` !

```ts title="/index.ts"
```ts title="/api.ts"

import type { IAdminUserExpressRequest } from 'adminforth';
import express from 'express';
Expand Down Expand Up @@ -417,11 +417,6 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
)
)
);

// serve after you added all api
admin.express.serve(app)
admin.discoverDatabases();

```

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.
Expand Down