mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Update trpc endpoint path from '/api/trpc' to '/trpc'
This commit is contained in:
5
.changeset/famous-taxis-deny.md
Normal file
5
.changeset/famous-taxis-deny.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Update trpc endpoint path from '/api/trpc' to '/trpc'
|
||||||
@@ -22,7 +22,7 @@ export const queryClient = new QueryClient({
|
|||||||
const trpcClient = createTRPCClient<AppRouter>({
|
const trpcClient = createTRPCClient<AppRouter>({
|
||||||
links: [
|
links: [
|
||||||
httpBatchLink({
|
httpBatchLink({
|
||||||
url: `${process.env.NEXT_PUBLIC_SERVER_URL}/api/trpc`,
|
url: `${process.env.NEXT_PUBLIC_SERVER_URL}/trpc`,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const queryClient = new QueryClient({
|
|||||||
const trpcClient = createTRPCClient<AppRouter>({
|
const trpcClient = createTRPCClient<AppRouter>({
|
||||||
links: [
|
links: [
|
||||||
httpBatchLink({
|
httpBatchLink({
|
||||||
url: `${process.env.NEXT_PUBLIC_SERVER_URL}/api/trpc`,
|
url: `${process.env.NEXT_PUBLIC_SERVER_URL}/trpc`,
|
||||||
fetch(url, options) {
|
fetch(url, options) {
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
...options,
|
...options,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { NextRequest } from 'next/server';
|
|||||||
|
|
||||||
function handler(req: NextRequest) {
|
function handler(req: NextRequest) {
|
||||||
return fetchRequestHandler({
|
return fetchRequestHandler({
|
||||||
endpoint: '/api/trpc',
|
endpoint: '/trpc',
|
||||||
req,
|
req,
|
||||||
router: appRouter,
|
router: appRouter,
|
||||||
createContext: () => createContext(req)
|
createContext: () => createContext(req)
|
||||||
@@ -15,5 +15,5 @@ export function middleware() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: '/api/:path*',
|
matcher: '/:path*',
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user