mirror of
https://github.com/vale981/apollo-server
synced 2025-03-16 15:56:41 -04:00
24 lines
488 B
TypeScript
24 lines
488 B
TypeScript
![]() |
import * as hapi from 'hapi';
|
||
|
import { HapiApollo } from './hapiApollo';
|
||
|
|
||
|
import testSuite, { Schema, CreateAppOptions } from './integrations.test';
|
||
|
|
||
|
function createApp(options: CreateAppOptions = {}) {
|
||
|
const server = new hapi.Server();
|
||
|
|
||
|
server.connection({
|
||
|
host: 'localhost',
|
||
|
port: 8000,
|
||
|
});
|
||
|
|
||
|
server.register({
|
||
|
register: new HapiApollo(),
|
||
|
options: { schema: Schema },
|
||
|
routes: { prefix: '/graphql' },
|
||
|
});
|
||
|
|
||
|
return server;
|
||
|
}
|
||
|
|
||
|
testSuite(createApp);
|