MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / serverConfig

Function serverConfig

examples/passport-login/src/index.ts:17–39  ·  view source on GitHub ↗
(
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  oauth2Providers: any,
)

Source from the content-addressed store, hash-verified

15 * @param oauth2Providers
16 */
17export 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

Callers 1

startApplicationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected