-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from TogetherCrew/development
Merge Development into the Main
- Loading branch information
Showing
35 changed files
with
2,588 additions
and
1,649 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pino, { Bindings } from 'pino'; | ||
import config from './index'; | ||
|
||
export default pino({ | ||
level: config.logger.level, | ||
formatters: { | ||
level: label => { | ||
return { level: label.toUpperCase() }; | ||
}, | ||
}, | ||
timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`, | ||
bindings: (bindings: Bindings) => { | ||
return { | ||
pid: bindings.pid, | ||
host: bindings.hostname, | ||
}; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import mongoose from 'mongoose'; | ||
import config from '../config'; | ||
import logger from '../config/logger'; | ||
|
||
// Connect to MongoDB | ||
export async function connectDB() { | ||
mongoose.set('strictQuery', false); | ||
mongoose.connect(config.mongoose.serverURL).then(() => { | ||
console.log('Connected to MongoDB!'); | ||
}); | ||
mongoose | ||
.connect(config.mongoose.serverURL) | ||
.then(() => { | ||
logger.info({ url: config.mongoose.serverURL }, 'Connected to MongoDB!'); | ||
}) | ||
.catch(error => logger.error({ url: config.mongoose.serverURL, error }, 'Failed to connect to MongoDB!')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.