Environment: server.

This is a beta feature.

If you don't use Telefunc's transformer on your server-side (see Telefunc Transformer) then you need to provide the list of your .telefunc.js files to Telefunc.

You do so by using:

// Environment: Server

import { config } from 'telefunc'

// List of telefunc files
config.telefuncFiles = [

// The root directory of the project
config.root = __dirname

See also config.root.

You usually define server-side configs (import { config } from 'telefunc') at your server entry. For example if you use Express.js:

// /server/index.js
// Environment: server

import express from 'express'
import { config } from 'telefunc'

const app = express()

// Config values can be set here
config.someServerSideSetting = 'some-value'

See also