()
| 6 | import { context } from './context' |
| 7 | |
| 8 | async function startServer() { |
| 9 | const apollo = new ApolloServer<BaseContext>({ |
| 10 | schema, |
| 11 | }) |
| 12 | |
| 13 | await apollo.start() |
| 14 | |
| 15 | const app = new Server({ |
| 16 | port: 4000, |
| 17 | }) |
| 18 | |
| 19 | await app.register({ |
| 20 | plugin: hapiApollo, |
| 21 | options: { |
| 22 | path: '/graphql', |
| 23 | context: async () => (context), |
| 24 | apolloServer: apollo, |
| 25 | } |
| 26 | }); |
| 27 | await app.start() |
| 28 | |
| 29 | } |
| 30 | |
| 31 | |
| 32 | startServer() |