-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmian.go
More file actions
33 lines (28 loc) · 737 Bytes
/
mian.go
File metadata and controls
33 lines (28 loc) · 737 Bytes
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 (
"net/http"
"github.com/go-ozzo/ozzo-routing"
"github.com/go-ozzo/ozzo-routing/slash"
"github.com/HaseProgram/technoparkdb/user"
"github.com/HaseProgram/technoparkdb/forum"
"github.com/HaseProgram/technoparkdb/thread"
"github.com/HaseProgram/technoparkdb/database"
"github.com/HaseProgram/technoparkdb/post"
"github.com/HaseProgram/technoparkdb/service"
)
var router *routing.Router
func main() {
database.Connect()
//defer database.DB.Close()
router := routing.New()
router.Use(
slash.Remover(http.StatusMovedPermanently),
)
user.Route(router)
forum.Route(router)
thread.Route(router)
post.Route(router)
service.Route(router)
http.Handle("/", router)
http.ListenAndServe(":5000", nil)
}