File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ exports.builder = {
4
4
port : {
5
5
alias : 'p' ,
6
6
description : 'port to start local server with voyager on' ,
7
- }
7
+ } ,
8
8
}
9
9
10
10
import * as express from 'express'
@@ -13,19 +13,22 @@ import * as graphqlHTTP from 'express-graphql'
13
13
import * as opn from 'opn'
14
14
import { buildSchema } from 'graphql'
15
15
16
- exports . handler = async function ( context , argv ) {
16
+ exports . handler = async function ( context , argv ) {
17
17
const config = await context . getProjectConfig ( )
18
18
const schema = buildSchema ( config . getSchemaSDL ( ) )
19
19
20
20
const app = express ( )
21
21
22
- app . use ( '/graphql' , graphqlHTTP ( {
23
- schema : schema
24
- } ) ) ;
22
+ app . use (
23
+ '/graphql' ,
24
+ graphqlHTTP ( {
25
+ schema : schema ,
26
+ } ) ,
27
+ )
25
28
26
29
app . use ( '/voyager' , middleware ( { endpointUrl : '/graphql' } ) )
27
30
28
- const port = parseInt ( argv . port ) || 7000 ;
31
+ const port = parseInt ( argv . port ) || 7000
29
32
const listener = app . listen ( port , ( ) => {
30
33
let host = listener . address ( ) . address
31
34
if ( host === '::' ) {
@@ -34,5 +37,5 @@ exports.handler = async function (context, argv) {
34
37
const link = `http://${ host } :${ port } /voyager`
35
38
console . log ( 'Serving voyager at %s' , link )
36
39
opn ( link )
37
- } ) ;
40
+ } )
38
41
}
You can’t perform that action at this time.
0 commit comments