initial
This commit is contained in:
commit
73b524d203
18 changed files with 1279 additions and 0 deletions
32
main.go
Normal file
32
main.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
_ "mobile-api-example/docs"
|
||||
"mobile-api-example/src/auth"
|
||||
"mobile-api-example/src/config"
|
||||
"mobile-api-example/src/server"
|
||||
"mobile-api-example/src/storage"
|
||||
)
|
||||
|
||||
// @Title Mobile Example API
|
||||
// @Version 1.0.0
|
||||
// @BasePath /api
|
||||
// @securityDefinitions.apikey ApiKeyAuth
|
||||
// @In header
|
||||
// @Name Authorization
|
||||
// @Description Введите "token" для аутентификации
|
||||
func main() {
|
||||
c := config.NewConfig()
|
||||
|
||||
db, err := storage.Connect()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
srv := server.NewServer()
|
||||
|
||||
auth.NewHandler(db, srv.BaseGroup)
|
||||
|
||||
srv.Run(c.Address)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue