Skip to content

Commit 6736e70

Browse files
committed
small fixes
1 parent 7ebd1ac commit 6736e70

File tree

4 files changed

+1085
-53
lines changed

4 files changed

+1085
-53
lines changed

config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const examplesPath = './examples';
1111
export 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

1717
export 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

mainPage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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}`;

mongooseConnection.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
});

0 commit comments

Comments
 (0)