You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
667 B
29 lines
667 B
3 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"Open_IM/internal/demo/register"
|
||
|
"Open_IM/pkg/common/log"
|
||
|
"Open_IM/pkg/utils"
|
||
|
"flag"
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
|
||
|
r := gin.Default()
|
||
|
r.Use(utils.CorsHandler())
|
||
|
|
||
|
authRouterGroup := r.Group("/auth")
|
||
|
{
|
||
|
authRouterGroup.POST("/code", register.SendVerificationCode)
|
||
|
authRouterGroup.POST("/verify", register.Verify)
|
||
|
authRouterGroup.POST("/password", register.SetPassword)
|
||
|
authRouterGroup.POST("/login", register.Login)
|
||
|
}
|
||
|
log.NewPrivateLog("demo")
|
||
|
ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port")
|
||
|
flag.Parse()
|
||
|
r.Run(utils.ServerIP + ":" + strconv.Itoa(*ginPort))
|
||
|
}
|