-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
33 lines (25 loc) · 767 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"context"
"fmt"
"time"
"github.com/jethro91/fiber-mongo-redis-boilerplate/src"
"github.com/jethro91/fiber-mongo-redis-boilerplate/src/config"
"github.com/jethro91/fiber-mongo-redis-boilerplate/src/database/mongoDB"
"github.com/jethro91/fiber-mongo-redis-boilerplate/src/database/mongoIndex"
"github.com/jethro91/fiber-mongo-redis-boilerplate/src/database/redisDB"
)
func main() {
app := src.CreateApp()
ctx, ctxCancel := context.WithTimeout(context.Background(), 10*time.Second)
defer ctxCancel()
mongoDB.CreateMongoDBConnection()
defer mongoDB.Client.Disconnect(ctx)
err := mongoIndex.CreateMongoIndexes()
if err != nil {
fmt.Println(err)
return
}
redisDB.CreateRedisDBConnection()
app.Listen(config.APP_LISTEN)
}