Intégration MongoDB + Fix export et amp
This commit is contained in:
		
							
								
								
									
										8
									
								
								src/events/mongo/connected.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/events/mongo/connected.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| import chalk from 'chalk' | ||||
|  | ||||
| export default { | ||||
| 	name: 'connected', | ||||
| 	async execute() { | ||||
| 		console.log(chalk.green('[Mongoose] Connected to MongoDB !')) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										8
									
								
								src/events/mongo/connecting.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/events/mongo/connecting.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| import chalk from 'chalk' | ||||
|  | ||||
| export default { | ||||
| 	name: 'connecting', | ||||
| 	async execute() { | ||||
| 		console.log(chalk.green('[Mongoose] Connecting to MongoDB...')) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										8
									
								
								src/events/mongo/disconnected.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/events/mongo/disconnected.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| import chalk from 'chalk' | ||||
|  | ||||
| export default { | ||||
| 	name: 'disconnected', | ||||
| 	async execute() { | ||||
| 		console.log(chalk.green('[Mongoose] Disconnected from MongoDB !')) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										8
									
								
								src/events/mongo/error.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/events/mongo/error.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| import chalk from 'chalk' | ||||
|  | ||||
| export default { | ||||
| 	name: 'error', | ||||
| 	async execute(error: Error) { | ||||
| 		console.log(chalk.red('[Mongoose] An error occured with the database conenction :\n' + error)) | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user