mirror of
https://github.com/alexgo-io/peggedassets-server.git
synced 2026-01-12 08:34:35 +08:00
* rewrite server * add docker config * update start script * chore: Remove unused INFLUXDB_TOKEN from deployment workflow and env files * use node v20 * fix dockerfile * Update cache initialization to remove duplicate await keyword Update API endpoint for fetching historical rates * fix api2 bug * hardcode UST to 0 * remove subpath --------- Co-authored-by: 0xngmi <0xngmi@protonmail.com>
24 lines
620 B
TypeScript
24 lines
620 B
TypeScript
|
|
|
|
const requiredEnvVars = ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY']
|
|
|
|
export function validateEnv() {
|
|
const ENV = process.env
|
|
|
|
if (requiredEnvVars.some((envVar) => !ENV[envVar]))
|
|
throw new Error(`Missing required environment variables: ${requiredEnvVars.join(', ')}`)
|
|
}
|
|
|
|
export default function geEnv() {
|
|
const ENV = process.env
|
|
|
|
if (!process.env.tableName) process.env.tableName = 'prod-stablecoins-table'
|
|
if (!process.env.AWS_REGION) process.env.AWS_REGION = 'eu-central-1'
|
|
|
|
|
|
return {
|
|
tableName: ENV.tableName,
|
|
AWS_REGION: ENV.AWS_REGION,
|
|
api2CacheDir: __dirname + '/.api2-cache',
|
|
}
|
|
} |