You usually define server-side configs (import { config } from 'telefunc') at your server entry. For example:
// /server/index.js// Environment: serverimport { config } from 'telefunc'const app = express() // If you use Express.jsconst app = new Hono() // If you use Hono// ...// Server configs can be set hereconfig.someServerSideSetting = 'some-value'
// /server/index.ts// Environment: serverimport { config } from 'telefunc'const app = express() // If you use Express.jsconst app = new Hono() // If you use Hono// ...// Server configs can be set hereconfig.someServerSideSetting = 'some-value'
Monorepo
If you have a monorepo structure, then set config.root to the root directory of your client-side (i.e. the root of Vite/Vike/Next.js/Nuxt/...). Don't set config.root to the monorepo root, nor to the root directory of your server. (The config.root setting enables Telefunc to match your .telefunc.js files/imports between the server-side and the client-side.)