0.0.1 • Published 8 months ago
@kakang/fastify-config v0.0.1
@kakang/fastify-config
This plugin use env-schema
to read the .env file and provides
the value through variables and fastify plugin.
Install
npm install @kakang/fastify-config --save
yarn add @kakang/fastify-config
Usage
import { build } from '@kakang/fastify-config'
const { env, plugin } = build({
schema: {
type: 'object',
properties: {
FOO: { type: 'string' }
}
},
data: process.env
dotenv: true
})
fastify.register(plugin)
fastify.config // here is the env value
0.0.1
8 months ago