sidecar network host
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { createTransport, type Transporter } from 'nodemailer';
|
||||
import { homedir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
|
||||
const { MAIL_TRANSPORT } = process.env;
|
||||
const { MAIL_TRANSPORT, DATA_PATH } = process.env;
|
||||
const dataPath = DATA_PATH ?? join(process.cwd(), 'data');
|
||||
|
||||
type SmtpConfig = {
|
||||
provider: 'resend' | 'smtp' | 'mailhog';
|
||||
@@ -15,7 +16,7 @@ type SmtpConfig = {
|
||||
fromEmail: string;
|
||||
};
|
||||
|
||||
const settingsPath = `${homedir()}/.config/officer.dev/server-settings.json`;
|
||||
const settingsPath = join(dataPath, 'server-settings', 'server-settings.json');
|
||||
|
||||
let cachedTransport: Transporter | null = null;
|
||||
let cachedConfigHash: string | null = null;
|
||||
|
||||
Reference in New Issue
Block a user