mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 10:11:40 -05:00

There were many missing releases and bullet points as well as inaccurate ones. For example, it was impossible to figure out that users of Hapi 16 who want to use Apollo Cache Control needed to use precisely version 1.2.0 of apollo-server-hapi (which wasn't even mentioned). Link to CHANGELOG from all READMEs. Add READMEs for the graphql-server-* packages. Add an explanation of our versioning system to the top of CHANGELOG.md.
1.4 KiB
1.4 KiB
title | description |
---|---|
Micro | Setting up Apollo Server with Micro |
This is the Micro integration for the Apollo community GraphQL Server. Read the docs. Read the CHANGELOG.
npm install apollo-server-micro
Example
import { microGraphiql, microGraphql } from 'apollo-server-micro';
import micro, { send } from 'micro';
import { get, post, router } from 'microrouter';
import schema from './schema';
const graphqlHandler = microGraphql({ schema });
const graphiqlHandler = microGraphiql({ endpointURL: '/graphql' });
const server = micro(
router(
get('/graphql', graphqlHandler),
post('/graphql', graphqlHandler),
get('/graphiql', graphiqlHandler),
(req, res) => send(res, 404, 'not found'),
),
);
server.listen(3000);