Using route.ts file with catchAll route
Unanswered
Kars posted this in #help-forum
KarsOP
Hey Community, pleased to meet y'all. I am currently integrating nextjs with sanity.io in which I am using catchAll route and this is my folder structure,
├── next-env.d.ts
├── next.config.mjs
├── package.json
├── pnpm-lock.yaml
├── public
│ ├── next.svg
│ └── placeholder40x40.svg
├── sanity.cli.ts
├── sanity.config.ts
├── sanity.types.ts
├── schema.json
├── src
│ ├── app
│ │ ├── [[...app]]
│ │ │ ├── layout.tsx
│ │ │ └── page.tsx
│ │ ├── favicon.ico
│ │ └── studio
│ │ ├── [[...tool]]
│ │ │ └── page.tsx
│ │ └── layout.tsx
│ ├── components
│ │ ├── Layout
│ │ │ ├── Footer
│ │ │ │ ├── footer.module.css
│ │ │ │ └── index.tsx
│ │ │ ├── Header
│ │ │ │ ├── NavDD.tsx
│ │ │ │ ├── NavSidebar.tsx
│ │ │ │ ├── header.module.css
│ │ │ │ └── index.tsx
│ │ │ └── index.tsx
└── tsconfig.json
Is it possible for me to use a route.ts file so that I can execute the enabling and disabling of the draftMode() api to access live-previews in nextjs-sanity.
This is what I am trying to achieve, [Link](https://www.sanity.io/guides/nextjs-app-router-live-preview#d41d5c903046).
├── next-env.d.ts
├── next.config.mjs
├── package.json
├── pnpm-lock.yaml
├── public
│ ├── next.svg
│ └── placeholder40x40.svg
├── sanity.cli.ts
├── sanity.config.ts
├── sanity.types.ts
├── schema.json
├── src
│ ├── app
│ │ ├── [[...app]]
│ │ │ ├── layout.tsx
│ │ │ └── page.tsx
│ │ ├── favicon.ico
│ │ └── studio
│ │ ├── [[...tool]]
│ │ │ └── page.tsx
│ │ └── layout.tsx
│ ├── components
│ │ ├── Layout
│ │ │ ├── Footer
│ │ │ │ ├── footer.module.css
│ │ │ │ └── index.tsx
│ │ │ ├── Header
│ │ │ │ ├── NavDD.tsx
│ │ │ │ ├── NavSidebar.tsx
│ │ │ │ ├── header.module.css
│ │ │ │ └── index.tsx
│ │ │ └── index.tsx
└── tsconfig.json
Is it possible for me to use a route.ts file so that I can execute the enabling and disabling of the draftMode() api to access live-previews in nextjs-sanity.
This is what I am trying to achieve, [Link](https://www.sanity.io/guides/nextjs-app-router-live-preview#d41d5c903046).