mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-12 23:35:52 +00:00
* add logger to context * add apollo logger * apollo logger plugin must be set on createServer to avoid spam in unit tests
17 lines
632 B
TypeScript
17 lines
632 B
TypeScript
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
|
|
import CONFIG from './config'
|
|
import { loggerPlugin } from './plugins/apolloLogger'
|
|
import createServer from './server'
|
|
|
|
const { server, httpServer } = createServer({
|
|
plugins: [loggerPlugin],
|
|
})
|
|
const url = new URL(CONFIG.GRAPHQL_URI)
|
|
httpServer.listen({ port: url.port }, () => {
|
|
/* eslint-disable-next-line no-console */
|
|
console.log(`🚀 Server ready at http://localhost:${url.port}${server.graphqlPath}`)
|
|
/* eslint-disable-next-line no-console */
|
|
console.log(`🚀 Subscriptions ready at ws://localhost:${url.port}${server.subscriptionsPath}`)
|
|
})
|