File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 3
3
import express from "express" ;
4
4
import * as config from "./config" ;
5
5
import Router from "./routes/router" ;
6
+ import { initMongoose } from "./libs/mongoose/init" ;
6
7
7
8
const app : express . Application = express ( ) ;
8
9
@@ -13,6 +14,8 @@ app.use("/", Router);
13
14
14
15
app . listen ( config . server . port , ( ) => {
15
16
console . log (
16
- `[AUTH SERVER] Listening on http://0.0.0.0:${ config . server . port } /`
17
+ `[AUTH SERVER] EVENT --> Listening on http://0.0.0.0:${ config . server . port } /`
17
18
) ;
18
19
} ) ;
20
+
21
+ initMongoose ( ) ;
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ import mongoose from "mongoose" ;
4
+ import * as config from "../../config" ;
5
+
6
+ export async function initMongoose ( ) {
7
+ await mongoose
8
+ . connect ( config . tokens . mongo )
9
+ . then ( ( ) => {
10
+ console . log (
11
+ `[AUTH SERVER] EVENT --> Mongoose connected to ${ config . tokens . mongo } `
12
+ ) ;
13
+ } )
14
+ . catch ( ( err ) => {
15
+ console . error ( `[AUTH SERVER] MONGOOSE ERROR --> ` , err ) ;
16
+ } ) ;
17
+ }
You can’t perform that action at this time.
0 commit comments