| 15 | * @param oauth2Providers |
| 16 | */ |
| 17 | export async function serverConfig( |
| 18 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 19 | oauth2Providers: any, |
| 20 | ): Promise<ApplicationConfig> { |
| 21 | const config = { |
| 22 | rest: { |
| 23 | port: +(process.env.PORT ?? 3000), |
| 24 | host: process.env.HOST, |
| 25 | protocol: 'http', |
| 26 | gracePeriodForClose: 5000, // 5 seconds |
| 27 | openApiSpec: { |
| 28 | setServersFromRequest: true, |
| 29 | }, |
| 30 | // Use the LB4 application as a route. It should not be listening. |
| 31 | listenOnStart: false, |
| 32 | }, |
| 33 | facebookOptions: oauth2Providers['facebook-login'], |
| 34 | googleOptions: oauth2Providers['google-login'], |
| 35 | twitterOptions: oauth2Providers['twitter-login'], |
| 36 | oauth2Options: oauth2Providers['oauth2'], |
| 37 | }; |
| 38 | return config; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * bind resources to application |