itslaves / rentalgames-server

0 stars 0 forks source link

서버 CLI 적용 #7

Closed skyoo2003 closed 5 years ago

skyoo2003 commented 5 years ago

cobra, viper 를 활용하여 CLI 기능을 적용했습니다.

$ go run main.go --help
RentalGames API server

Usage:
  rentalgames [command]

Available Commands:
  debug       Debug API server
  help        Help about any command

Flags:
  -E, --env string   API server environment (default "develop")
  -h, --help         help for rentalgames

Use "rentalgames [command] --help" for more information about a command.

$ go run main.go debug -p 8888
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] Loaded HTML Templates (4): 
        - index.tmpl
        - kakao.tmpl
        - login.html
        - 

[GIN-debug] GET    /login                    --> github.com/itslaves/rentalgames-server/auth.LoginView (4 handlers)
[GIN-debug] GET    /auth/callback            --> github.com/itslaves/rentalgames-server/auth.Authenticate (4 handlers)
[GIN-debug] GET    /logout                   --> github.com/itslaves/rentalgames-server/route.Route.func1 (4 handlers)
[GIN-debug] GET    /kakao                    --> github.com/itslaves/rentalgames-server/route.Route.func2 (4 handlers)
[GIN-debug] GET    /kakao-user               --> github.com/itslaves/rentalgames-server/route.Route.func3 (4 handlers)
[GIN-debug] GET    /index                    --> github.com/itslaves/rentalgames-server/route.Route.func4 (4 handlers)
[GIN-debug] GET    /articles                 --> github.com/itslaves/rentalgames-server/article.Retrieve (4 handlers)
[GIN-debug] POST   /articles                 --> github.com/itslaves/rentalgames-server/article.Create (4 handlers)
[GIN-debug] PUT    /articles/:id             --> github.com/itslaves/rentalgames-server/article.Update (4 handlers)
[GIN-debug] GET    /ping                     --> github.com/itslaves/rentalgames-server/route.Route.func5 (4 handlers)
[GIN-debug] Listening and serving HTTP on :8888

Resolves https://github.com/itslaves/rentalgames-server/issues/6

skyoo2003 commented 5 years ago

이것도 일단 머지하고 수정사항 있으면 별도 PR로 올려주세여 ㅋ