mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-02-01 04:37:55 +01:00
refactor: use trpc url from config
This commit is contained in:
@@ -51,14 +51,11 @@ export default defineNuxtModule<ModuleOptions>({
|
|||||||
getContents() {
|
getContents() {
|
||||||
return `
|
return `
|
||||||
import { createTRPCHandler } from 'trpc-nuxt/api'
|
import { createTRPCHandler } from 'trpc-nuxt/api'
|
||||||
import { useRuntimeConfig } from '#imports'
|
|
||||||
import * as functions from '${trpcOptionsPath}'
|
import * as functions from '${trpcOptionsPath}'
|
||||||
|
|
||||||
const { trpc: { trpcURL } } = useRuntimeConfig().public
|
|
||||||
|
|
||||||
export default createTRPCHandler({
|
export default createTRPCHandler({
|
||||||
...functions,
|
...functions,
|
||||||
trpcURL
|
trpcURL: '${finalConfig.trpcURL}'
|
||||||
})
|
})
|
||||||
`
|
`
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user