mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
now working several instances parallel depending on env-Vars
This commit is contained in:
parent
d3fa08bc48
commit
ef5afd830c
@ -11,11 +11,12 @@
|
||||
"build": "tsc --build",
|
||||
"clean": "tsc --build --clean",
|
||||
"start": "cross-env TZ=UTC TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/src/index.js",
|
||||
"dev": "cross-env TZ=UTC nodemon -w src --ext ts --exec ts-node -r tsconfig-paths/register src/index.ts",
|
||||
"dev": "cross-env TZ=UTC nodemon -w src --ext ts --exec ts-node -r dotenv/config -r tsconfig-paths/register src/index.ts",
|
||||
"lint": "eslint --max-warnings=0 --ext .js,.ts ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@hyperswarm/dht": "^6.3.3",
|
||||
"@types/dotenv": "^8.2.0",
|
||||
"@types/i18n": "^0.13.6",
|
||||
"@types/jsonwebtoken": "^8.5.9",
|
||||
"@types/lodash.clonedeep": "^4.5.7",
|
||||
|
||||
@ -1,44 +1,10 @@
|
||||
import { Field, ObjectType, Query, Resolver } from 'type-graphql'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
/*
|
||||
|
||||
@ObjectType()
|
||||
export class GetTestApiResult {
|
||||
constructor(apiVersion: string) {
|
||||
this.api = `test ${apiVersion}`
|
||||
}
|
||||
|
||||
@Field(() => String)
|
||||
api: string
|
||||
}
|
||||
|
||||
export class TestResolver {
|
||||
@Query(() => GetTestApiResult)
|
||||
async test(): Promise<String> {
|
||||
const api = `1_0`
|
||||
logger.info(`test apiVersion=1_0`)
|
||||
return new GetTestApiResult(api)
|
||||
}
|
||||
}
|
||||
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const test = gql`
|
||||
query {
|
||||
test {
|
||||
api
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ObjectType()
|
||||
class GetTestApiResult {
|
||||
constructor(apiVersion: string) {
|
||||
this.api = `test ${apiVersion}`
|
||||
this.api = `${apiVersion}`
|
||||
}
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
@ -1,44 +1,10 @@
|
||||
import { Field, ObjectType, Query, Resolver } from 'type-graphql'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
/*
|
||||
|
||||
@ObjectType()
|
||||
export class GetTestApiResult {
|
||||
constructor(apiVersion: string) {
|
||||
this.api = `test ${apiVersion}`
|
||||
}
|
||||
|
||||
@Field(() => String)
|
||||
api: string
|
||||
}
|
||||
|
||||
export class TestResolver {
|
||||
@Query(() => GetTestApiResult)
|
||||
async test(): Promise<String> {
|
||||
const api = `1_0`
|
||||
logger.info(`test apiVersion=1_0`)
|
||||
return new GetTestApiResult(api)
|
||||
}
|
||||
}
|
||||
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const test = gql`
|
||||
query {
|
||||
test {
|
||||
api
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ObjectType()
|
||||
class GetTestApiResult {
|
||||
constructor(apiVersion: string) {
|
||||
this.api = `test ${apiVersion}`
|
||||
this.api = `${apiVersion}`
|
||||
}
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
@ -1,44 +1,10 @@
|
||||
import { Field, ObjectType, Query, Resolver } from 'type-graphql'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
/*
|
||||
|
||||
@ObjectType()
|
||||
export class GetTestApiResult {
|
||||
constructor(apiVersion: string) {
|
||||
this.api = `test ${apiVersion}`
|
||||
}
|
||||
|
||||
@Field(() => String)
|
||||
api: string
|
||||
}
|
||||
|
||||
export class TestResolver {
|
||||
@Query(() => GetTestApiResult)
|
||||
async test(): Promise<String> {
|
||||
const api = `1_0`
|
||||
logger.info(`test apiVersion=1_0`)
|
||||
return new GetTestApiResult(api)
|
||||
}
|
||||
}
|
||||
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
export const test = gql`
|
||||
query {
|
||||
test {
|
||||
api
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ObjectType()
|
||||
class GetTestApiResult {
|
||||
constructor(apiVersion: string) {
|
||||
this.api = `test ${apiVersion}`
|
||||
this.api = `${apiVersion}`
|
||||
}
|
||||
|
||||
@Field(() => String)
|
||||
|
||||
@ -10,7 +10,10 @@ async function main() {
|
||||
// in case of active DHT running on port 5000 else running on (default=5001) CONFIG.FEDERATION_PORT
|
||||
const port = CONFIG.FEDERATION_DHT_TOPIC ? 5000 : CONFIG.FEDERATION_PORT
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`configured: FEDERATION_DHT_TOPIC=${CONFIG.FEDERATION_DHT_TOPIC}, FEDERATION_PORT=${CONFIG.FEDERATION_PORT} => port=${port}`)
|
||||
console.log(`FEDERATION_PORT=${CONFIG.FEDERATION_PORT}`)
|
||||
console.log(`FEDERATION_API=${CONFIG.FEDERATION_API}`)
|
||||
console.log(`configured: FEDERATION_DHT_TOPIC=${CONFIG.FEDERATION_DHT_TOPIC}`)
|
||||
console.log(`depending on DHT_TOPIC using => port=${port}`)
|
||||
const { app } = await createServer()
|
||||
|
||||
app.listen(port, () => {
|
||||
|
||||
@ -271,6 +271,13 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.10.tgz#61cc8469849e5bcdd0c7044122265c39cec10cf4"
|
||||
integrity sha512-C7srjHiVG3Ey1nR6d511dtDkCEjxuN9W1HWAEjGq8kpcwmNM6JJkpC0xvabM7BXTG2wDq8Eu33iH9aQKa7IvLQ==
|
||||
|
||||
"@types/dotenv@^8.2.0":
|
||||
version "8.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/dotenv/-/dotenv-8.2.0.tgz#5cd64710c3c98e82d9d15844375a33bf1b45d053"
|
||||
integrity sha512-ylSC9GhfRH7m1EUXBXofhgx4lUWmFeQDINW5oLuS+gxWdfUeW4zJdeVTYVkexEW+e2VUvlZR2kGnGGipAWR7kw==
|
||||
dependencies:
|
||||
dotenv "*"
|
||||
|
||||
"@types/express-serve-static-core@^4.17.18", "@types/express-serve-static-core@^4.17.21":
|
||||
version "4.17.31"
|
||||
resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f"
|
||||
@ -1005,6 +1012,11 @@ diff@^4.0.1:
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
|
||||
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
|
||||
|
||||
dotenv@*:
|
||||
version "16.0.3"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07"
|
||||
integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==
|
||||
|
||||
dotenv@10.0.0:
|
||||
version "10.0.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user