You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.8 KiB
TypeScript
49 lines
1.8 KiB
TypeScript
import fs from "fs";
|
|
|
|
import dotenv from "dotenv";
|
|
dotenv.config();
|
|
|
|
if (process.env.PORT === undefined) {
|
|
throw ("The environment variable 'PORT' has not been set");
|
|
}
|
|
|
|
if (process.env.PUBLIC_KEY_LOCATION === undefined) {
|
|
throw ("The environment variable 'PUBLIC_KEY_LOCATION' has not been set");
|
|
}
|
|
|
|
if (process.env.PRIVATE_KEY_LOCATION === undefined) {
|
|
throw ("The environment variable 'PRIVATE_KEY_LOCATION' has not been set");
|
|
}
|
|
|
|
if (process.env.STRIPE_SECRET_KEY === undefined) {
|
|
throw ("The environment variable 'STRIPE_SECRET_KEY' has not been set");
|
|
}
|
|
|
|
if (process.env.STRIPE_PUBLIC_KEY === undefined) {
|
|
throw ("The environment variable 'STRIPE_PUBLIC_KEY' has not been set");
|
|
}
|
|
|
|
if (process.env.STRIPE_WEBHOOK_SECRET === undefined) {
|
|
throw ("The environment variable 'STRIPE_WEBHOOK_SECRET' has not been set");
|
|
}
|
|
|
|
if (process.env.BASE_URL === undefined) {
|
|
throw ("The environment variable 'BASE_URL' has not been set");
|
|
}
|
|
|
|
export const public_key: string = fs.readFileSync(process.env.PUBLIC_KEY_LOCATION, { encoding: "utf-8" });
|
|
|
|
export const private_key: string = fs.readFileSync(process.env.PRIVATE_KEY_LOCATION, { encoding: "utf-8" });
|
|
|
|
export const port: string = process.env.PORT;
|
|
|
|
export const stripePrivateKey: string = process.env.STRIPE_SECRET_KEY;
|
|
export const stripePublicKey: string = process.env.STRIPE_PUBLIC_KEY;
|
|
export const stripeWebhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET;
|
|
|
|
export const baseURL: string = process.env.BASE_URL;
|
|
|
|
export const smtpHostname: string | undefined = process.env.SMTP_HOSTNAME;
|
|
export const smtpUsername: string | undefined = process.env.SMTP_USERNAME;
|
|
export const smtpPassword: string | undefined = process.env.SMTP_PASSWORD;
|
|
export const smtpAddress: string | undefined = process.env.SMTP_ADDRESS; |