mirror of
https://github.com/hexolan/panels.git
synced 2026-03-27 04:44:10 +00:00
init user-service
This commit is contained in:
20
services/user-service/src/config.ts
Normal file
20
services/user-service/src/config.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
function getMongoURI(): string {
|
||||
if (process.env.MONGODB_URI === undefined) {
|
||||
throw new Error("mongodb_uri configuration not provided");
|
||||
} else {
|
||||
return process.env.MONGODB_URI
|
||||
}
|
||||
}
|
||||
|
||||
function getKafkaBrokers(): string[] {
|
||||
if (process.env.KAFKA_BROKERS === undefined) {
|
||||
throw new Error("kafka_brokers configuration not provided");
|
||||
} else {
|
||||
return process.env.KAFKA_BROKERS.split(",")
|
||||
}
|
||||
}
|
||||
|
||||
const mongodbUri = getMongoURI();
|
||||
const kafkaBrokers = getKafkaBrokers();
|
||||
|
||||
export { mongodbUri, kafkaBrokers }
|
||||
Reference in New Issue
Block a user