File tree Expand file tree Collapse file tree 6 files changed +15
-30
lines changed Expand file tree Collapse file tree 6 files changed +15
-30
lines changed Original file line number Diff line number Diff line change 2
2
logs
3
3
* .log
4
4
lib
5
- dist
6
5
7
6
# Runtime data
8
7
pids
9
8
* .pid
10
9
* .seed
11
10
12
- # Directory for instrumented libs generated by jscoverage/JSCover
13
- lib-cov
14
-
15
11
# Coverage directory used by tools like istanbul
16
12
coverage
17
13
18
- # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
19
- .grunt
20
-
21
- # node-waf configuration
22
- .lock-wscript
23
-
24
- # Compiled binary addons (http://nodejs.org/api/addons.html)
25
- build /Release
26
-
27
14
# Dependency directory
28
15
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
29
16
node_modules
Original file line number Diff line number Diff line change 1
1
coverage
2
2
.travis.yml
3
3
example
4
- .idea
5
- src
6
4
* .spec.js
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import {getSchema} from '../src';
6
6
7
7
import User from './user' ;
8
8
9
+ mongoose . Promise = global . Promise ;
9
10
mongoose . connect ( process . env . MONGO_URI || 'mongodb://localhost/graphql' ) ;
10
11
const port = process . env . PORT || 8080 ;
11
12
@@ -35,10 +36,14 @@ app.use(graffiti.koa({
35
36
} ) ) ;
36
37
37
38
// redirect all requests to /graphql
38
- app . use ( function * redirect ( ) {
39
+ app . use ( function * redirect ( next ) {
39
40
this . redirect ( '/graphql' ) ;
41
+ yield next ;
40
42
} ) ;
41
43
42
- app . listen ( port ) ;
43
-
44
- console . log ( `Started on http://localhost:${ port } /` ) ;
44
+ app . listen ( port , ( err ) => {
45
+ if ( err ) {
46
+ throw err ;
47
+ }
48
+ console . log ( `Started on http://localhost:${ port } /` ) ;
49
+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
"name" : " graffiti-mongoose-example" ,
3
3
"description" : " An example using graffiti-mongoose" ,
4
4
"scripts" : {
5
- "start" : " node index .js"
5
+ "start" : " babel- node app .js"
6
6
},
7
7
"dependencies" : {
8
8
"@risingstack/graffiti" : " ^3.0.3" ,
9
9
"@risingstack/graffiti-mongoose" : " ../" ,
10
- "babel-runtime" : " ^6.5.0" ,
11
- "koa" : " ^1.1.2" ,
12
- "koa-bodyparser" : " ^2.0.1"
13
- },
14
- "devDependencies" : {
15
- "babel" : " ^6.5.1"
10
+ "babel-cli" : " 6.11.4" ,
11
+ "babel-runtime" : " 6.9.2" ,
12
+ "koa" : " 1.2.1" ,
13
+ "koa-bodyparser" : " 2.2.0"
16
14
}
17
15
}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ User.remove().then(() => {
29
29
users . push ( new User ( {
30
30
name : `User${ i } ` ,
31
31
age : i ,
32
- createdAt : new Date ( ) + i * 100 ,
32
+ createdAt : new Date ( ) + ( i * 100 ) ,
33
33
friends : users . map ( ( i ) => i . _id ) ,
34
34
nums : [ 0 , i ] ,
35
35
bools : [ true , false ] ,
You can’t perform that action at this time.
0 commit comments