feat: add webhook-first app router with wallet, job, and unlock endpoints
This commit is contained in:
28
src/config.js
Normal file
28
src/config.js
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
function intFromEnv(name, fallback) {
|
||||
const raw = process.env[name];
|
||||
if (!raw) {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
const parsed = Number.parseInt(raw, 10);
|
||||
return Number.isInteger(parsed) ? parsed : fallback;
|
||||
}
|
||||
|
||||
const config = {
|
||||
port: intFromEnv("PORT", 3000),
|
||||
xWebhookSecret: process.env.X_WEBHOOK_SECRET || "dev-x-secret",
|
||||
polarWebhookSecret: process.env.POLAR_WEBHOOK_SECRET || "dev-polar-secret",
|
||||
credit: {
|
||||
baseCredits: intFromEnv("BASE_CREDITS", 1),
|
||||
includedChars: intFromEnv("INCLUDED_CHARS", 25000),
|
||||
stepChars: intFromEnv("STEP_CHARS", 10000),
|
||||
stepCredits: intFromEnv("STEP_CREDITS", 1),
|
||||
maxCharsPerArticle: intFromEnv("MAX_CHARS_PER_ARTICLE", 120000),
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
config,
|
||||
};
|
||||
Reference in New Issue
Block a user