mirror of
https://github.com/FranP-code/countries.git
synced 2025-10-13 00:02:15 +00:00
Customize the production landing page
This commit is contained in:
9
index.js
9
index.js
@@ -1,4 +1,5 @@
|
|||||||
import {ApolloServer, gql} from 'apollo-server';
|
import {ApolloServer, gql} from 'apollo-server';
|
||||||
|
import {ApolloServerPluginLandingPageProductionDefault} from 'apollo-server-core';
|
||||||
import {buildSubgraphSchema} from '@apollo/subgraph';
|
import {buildSubgraphSchema} from '@apollo/subgraph';
|
||||||
import {readFileSync} from 'fs';
|
import {readFileSync} from 'fs';
|
||||||
import {resolvers} from './resolvers.js';
|
import {resolvers} from './resolvers.js';
|
||||||
@@ -7,7 +8,13 @@ const typeDefs = gql(readFileSync('./schema.graphql', 'utf-8'));
|
|||||||
|
|
||||||
const server = new ApolloServer({
|
const server = new ApolloServer({
|
||||||
schema: buildSubgraphSchema({typeDefs, resolvers}),
|
schema: buildSubgraphSchema({typeDefs, resolvers}),
|
||||||
introspection: true
|
introspection: true,
|
||||||
|
plugins: [
|
||||||
|
ApolloServerPluginLandingPageProductionDefault({
|
||||||
|
footer: false,
|
||||||
|
graphRef: process.env.APOLLO_GRAPH_REF
|
||||||
|
})
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen({port: process.env.PORT || 4000}).then(({url}) => {
|
server.listen({port: process.env.PORT || 4000}).then(({url}) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user