add auth and payment api
This commit is contained in:
@@ -16,5 +16,41 @@ export const _env = z
|
||||
DATABASE_USERNAME: z.string("Must be string.").nonempty("Must not empty."),
|
||||
DATABASE_PASSWORD: z.string("Must be string.").nonempty("Must not empty."),
|
||||
DATABASE_NAME: z.string("Must be string.").nonempty("Must not empty."),
|
||||
|
||||
JWT_SECRET: z.string("Must be string.").nonempty("Must not empty."),
|
||||
JWT_ALGORITHM: z.enum(
|
||||
[
|
||||
"HS256",
|
||||
"HS384",
|
||||
"HS512",
|
||||
"RS256",
|
||||
"RS384",
|
||||
"RS512",
|
||||
"ES256",
|
||||
"ES384",
|
||||
"ES512",
|
||||
"PS256",
|
||||
"PS384",
|
||||
"PS512",
|
||||
],
|
||||
"Invalid value.",
|
||||
),
|
||||
JWT_ISSUER: z.string("Must be string.").nonempty("Must not empty."),
|
||||
|
||||
MIDTRANS_BASE_URL: z.url("Must be valid URL.").nonempty("Must not empty."),
|
||||
MIDTRANS_MERCHANT_ID: z
|
||||
.string("Must be string.")
|
||||
.nonempty("Must not empty."),
|
||||
MIDTRANS_SERVER_KEY: z
|
||||
.string("Must be string.")
|
||||
.nonempty("Must not empty."),
|
||||
|
||||
MAIL_HOST: z.string("Must be string.").nonempty("Must not empty."),
|
||||
MAIL_PORT: z.coerce
|
||||
.number("Must be number.")
|
||||
.int("Must be integer.")
|
||||
.min(0, "Min 0."),
|
||||
MAIL_USERNAME: z.string("Must be string.").nonempty("Must not empty."),
|
||||
MAIL_PASSWORD: z.string("Must be string.").nonempty("Must not empty."),
|
||||
})
|
||||
.parse(Bun.env);
|
||||
|
||||
7
src/configs/jwt.config.ts
Normal file
7
src/configs/jwt.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { _env } from "@/configs/_env";
|
||||
|
||||
export const jwtConfig = {
|
||||
secret: _env.JWT_SECRET,
|
||||
algorithm: _env.JWT_ALGORITHM,
|
||||
issuer: _env.JWT_ISSUER,
|
||||
} as const;
|
||||
8
src/configs/mail.config.ts
Normal file
8
src/configs/mail.config.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { _env } from "@/configs/_env";
|
||||
|
||||
export const mailConfig = {
|
||||
host: _env.MAIL_HOST,
|
||||
port: _env.MAIL_PORT,
|
||||
username: _env.MAIL_USERNAME,
|
||||
password: _env.MAIL_PASSWORD,
|
||||
} as const;
|
||||
7
src/configs/midtrans.config.ts
Normal file
7
src/configs/midtrans.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { _env } from "@/configs/_env";
|
||||
|
||||
export const midtransConfig = {
|
||||
baseUrl: _env.MIDTRANS_BASE_URL,
|
||||
merchantId: _env.MIDTRANS_MERCHANT_ID,
|
||||
serverKey: _env.MIDTRANS_SERVER_KEY,
|
||||
} as const;
|
||||
Reference in New Issue
Block a user