mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 10:11:40 -05:00
Merge pull request #165 from conrad-vanl/fix-readme-connect
Fix readme example for using connect.js
This commit is contained in:
commit
10dd9097cc
2 changed files with 6 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
### VNEXT
|
||||
* Pass `ctx` instead of `ctx.request` to options function in Koa integration ([@HriBB](https://github.com/HriBB)) in [PR #154](https://github.com/apollostack/apollo-server/pull/154)
|
||||
* Manage TypeScript declaration files using npm. ([@od1k](https:/github.com/od1k) in [#162](https://github.com/apollostack/apollo-server/pull/162))
|
||||
* Fix connect example in readme. ([@conrad-vanl](https://github.com/conrad-vanl) in [#165](https://github.com/apollostack/apollo-server/pull/165))
|
||||
|
||||
### v0.3.2
|
||||
* Added missing exports for hapi integration ([@nnance](https://github.com/nnance)) in [PR #152](https://github.com/apollostack/apollo-server/pull/152)
|
||||
|
|
|
@ -46,15 +46,18 @@ app.listen(PORT);
|
|||
### Connect
|
||||
```js
|
||||
import connect from 'connect';
|
||||
import bodyParser from 'body-parser';
|
||||
import { apolloConnect } from 'apollo-server';
|
||||
import http from 'http';
|
||||
|
||||
const PORT = 3000;
|
||||
|
||||
var app = connect();
|
||||
|
||||
app.use('/graphql', bodyParser.json(), apolloConnect({ schema: myGraphQLSchema }));
|
||||
app.use('/graphql', bodyParser.json());
|
||||
app.use('/graphql', apolloConnect({ schema: myGraphQLSchema }));
|
||||
|
||||
app.listen(PORT);
|
||||
http.createServer(app).listen(PORT);
|
||||
```
|
||||
|
||||
### Hapi
|
||||
|
|
Loading…
Add table
Reference in a new issue