parent
1d08329651
commit
859c7277ca
1 changed files with 4 additions and 6 deletions
10
docs/apl.md
10
docs/apl.md
|
@ -137,14 +137,12 @@ Now you can use it for in your view:
|
||||||
```ts
|
```ts
|
||||||
import { SALEOR_API_URL_HEADER } from "@saleor/app-sdk/const";
|
import { SALEOR_API_URL_HEADER } from "@saleor/app-sdk/const";
|
||||||
import { withRegisteredSaleorDomainHeader } from "@saleor/app-sdk/middleware";
|
import { withRegisteredSaleorDomainHeader } from "@saleor/app-sdk/middleware";
|
||||||
import type { Handler } from "retes";
|
import { NextApiHandler } from "next";
|
||||||
import { toNextHandler } from "retes/adapter";
|
|
||||||
import { Response } from "retes/response";
|
|
||||||
|
|
||||||
// import created APL
|
// import created APL
|
||||||
import { apl } from "@lib/saleorApp";
|
import { apl } from "@lib/saleorApp";
|
||||||
|
|
||||||
const handler: Handler = async (request) => {
|
const handler: NextApiHandler = async (request, response) => {
|
||||||
const saleorApiUrl = request.headers[SALEOR_API_URL_HEADER];
|
const saleorApiUrl = request.headers[SALEOR_API_URL_HEADER];
|
||||||
|
|
||||||
// Get auth data
|
// Get auth data
|
||||||
|
@ -152,10 +150,10 @@ const handler: Handler = async (request) => {
|
||||||
|
|
||||||
// view logic...
|
// view logic...
|
||||||
|
|
||||||
return Response.OK();
|
return response.status(200).end();
|
||||||
};
|
};
|
||||||
|
|
||||||
export default toNextHandler([withRegisteredSaleorDomainHeader({ apl }), handler]);
|
export default handler;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Available APLs
|
## Available APLs
|
||||||
|
|
Loading…
Reference in a new issue