mirror of
https://github.com/IT4Change/IT4C.dev.git
synced 2025-12-13 09:25:49 +00:00
* backend - mail api for it4c Implements an fastify backend service with an email service. This allows to send us emails received via contact form on the website. * optional telephone * missing text delimiter * start command and correct build method to classicjs * deploy for backend & adjust README.md * debug deploy [1] * debug deploy [2] * debug deploy [3] * debug deploy [4] * debug deploy [5] * finish deploy script * watch when running npm run dev * fix format validation * debug sendmail[1] * debug sendmail[2] * debug sendmail[3] * debug sendmail[4] * debug sendmail[5] * env for MAIL_HOST * referece name in email subject * fix format string * eslint * backend build & lint workflows * order comments * unit tests * unit test workflow * prettier * alias paths * fix esm support * 100% tests * corrected nodejs version * use beforeEach to clearAllMocks This simplifies the code and reduces redundancy * fix wrong import
36 lines
678 B
TypeScript
36 lines
678 B
TypeScript
import { load } from 'ts-dotenv'
|
|
|
|
import type { EnvType } from 'ts-dotenv'
|
|
|
|
export const schema = {
|
|
NODE_ENV: {
|
|
type: ['production' as const, 'development' as const, 'test' as const],
|
|
default: 'development',
|
|
},
|
|
EMAIL_RECEIVER: {
|
|
type: String,
|
|
default: 'admin@it4c.dev',
|
|
},
|
|
EMAIL_SUBJECT: {
|
|
type: String,
|
|
default: '[IT4C] Received EMail from %s',
|
|
},
|
|
PORT: {
|
|
type: Number,
|
|
default: 3000,
|
|
},
|
|
MAIL_HOST: {
|
|
type: String,
|
|
default: 'localhost',
|
|
},
|
|
}
|
|
|
|
export type Env = EnvType<typeof schema>
|
|
|
|
// eslint-disable-next-line import/no-mutable-exports
|
|
export let env: Env
|
|
|
|
export function loadEnv(): void {
|
|
env = load(schema)
|
|
}
|