Skip to content

Commit

Permalink
(test) qa 배포 테스트 (#2) (#3)
Browse files Browse the repository at this point in the history
* add: 테스트를 위한 컨트롤러 추가

* fix: 빌드 파일 지정

* roback: 이전 스크립트로 롤백

* fix: 모든 파일 빌드되도록 수정

* docs: 설명추가
  • Loading branch information
parkgang committed May 14, 2021
1 parent c328047 commit d59feab
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# [해당 문서를 참고하였습니다](https://thesorauniverse.com/posts/kr/golang/making-golang-docker-img-best-practices/)
FROM golang:1.16.3 AS builder

ENV GO111MODULE=on \
Expand All @@ -7,7 +8,7 @@ ENV GO111MODULE=on \

WORKDIR /build

COPY go.mod go.sum main.go ./
COPY . .

RUN go mod download

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ redis와 의존됩니다.

1. `go mod init oauth-server`
1. `go get -u github.com/gin-gonic/gin`
1. `Launch Package` 템플릿으로 디버깅 환경 구축
1. `.vscode/launch.json``Launch Package` 템플릿으로 디버깅 환경 구축
19 changes: 19 additions & 0 deletions controller/login.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package controller

import (
"net/http"

"github.com/gin-gonic/gin"
)

func Login(c *gin.Context) {
var msg struct {
Name string `json:"user"`
Message string
Number int
}
msg.Name = "Lena"
msg.Message = "hey"
msg.Number = 123
c.JSON(http.StatusOK, msg)
}
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"oauth-server/controller"

"github.com/gin-gonic/gin"
)

Expand All @@ -11,5 +13,6 @@ func main() {
"message": "pong",
})
})
r.GET("/login", controller.Login)
r.Run(":3000")
}

0 comments on commit d59feab

Please sign in to comment.