File tree Expand file tree Collapse file tree 4 files changed +1085
-53
lines changed Expand file tree Collapse file tree 4 files changed +1085
-53
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export const examplesPath = './examples';
1111export function getDirectories ( srcPath : string ) : string [ ] {
1212 return fs
1313 . readdirSync ( srcPath )
14- . filter ( file => fs . statSync ( path . join ( srcPath , file ) ) . isDirectory ( ) ) ;
14+ . filter ( ( file ) => fs . statSync ( path . join ( srcPath , file ) ) . isDirectory ( ) ) ;
1515}
1616
1717export function resolveExamplePath ( ...args : any ) {
@@ -23,14 +23,14 @@ export function getExampleNames() {
2323 const dirs = getDirectories ( examplesPath ) ;
2424
2525 const result = [ ] ;
26- preferableOrder . forEach ( name => {
26+ preferableOrder . forEach ( ( name ) => {
2727 const idx = dirs . indexOf ( name ) ;
2828 if ( idx !== - 1 ) {
2929 result . push ( name ) ;
3030 dirs . splice ( idx , 1 ) ;
3131 }
3232 } ) ;
33- dirs . forEach ( name => {
33+ dirs . forEach ( ( name ) => {
3434 result . push ( name ) ;
3535 } ) ;
3636
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ function renderExamplesLinks() {
3535 queries . push (
3636 `<b><a href="${ meta . uri } -altair" target="_blank">Altair</a> (improved GraphiQL IDE)</b>`
3737 ) ;
38+ queries . push (
39+ `<b><a href="${ meta . uri } -voyager" target="_blank">Voyager</a> (visual inspection tool)</b>`
40+ ) ;
3841 const queriesHtml = `<ul><li>${ queries . join ( '</li><li>' ) } </li></ul>` ;
3942
4043 return `${ titleHtml } ${ descriptionHtml } ${ queriesHtml } ` ;
Original file line number Diff line number Diff line change @@ -24,6 +24,15 @@ connection.on('error', (e) => {
2424 }
2525 console . log ( e ) ;
2626} ) ;
27- connection . once ( 'open ', ( ) => {
27+ connection . on ( 'connected ', ( ) => {
2828 console . log ( `MongoDB successfully connected to ${ mongoUri } ` ) ;
2929} ) ;
30+ connection . on ( 'reconnected' , ( ) => {
31+ console . log ( 'MongoDB reconnected!' ) ;
32+ } ) ;
33+
34+ process . on ( 'SIGINT' , async ( ) => {
35+ await connection . close ( ) ;
36+ console . log ( 'Force to close the MongoDB conection' ) ;
37+ process . exit ( 0 ) ;
38+ } ) ;
You can’t perform that action at this time.
0 commit comments