main.go 476 字节
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1 2 3 4
package main

import (
	"main/config"
5 6 7
	"main/init/initRouter"
	"main/init/mysql"
	"main/init/registTable"
Mr.奇淼('s avatar
Mr.奇淼( 已提交
8 9 10 11 12
	"net/http"
	"time"
)

func main() {
13 14 15 16

	registTable.RegistTable(mysql.InitMysql(config.Dbconfig.Admin))
	defer mysql.DEFAULTDB.Close()
	Router := initRouter.InitRouter()
Mr.奇淼('s avatar
Mr.奇淼( 已提交
17 18
	s := &http.Server{
		Addr:           ":8888",
19
		Handler:        Router,
Mr.奇淼('s avatar
Mr.奇淼( 已提交
20 21 22 23 24 25
		ReadTimeout:    10 * time.Second,
		WriteTimeout:   10 * time.Second,
		MaxHeaderBytes: 1 << 20,
	}
	_ = s.ListenAndServe()
}