File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,5 @@ RUN apk --no-cache add ca-certificates
1515WORKDIR /app
1616COPY --from=builder /api .
1717
18+ ENTRYPOINT ["./docker-entrypoint.sh"]
1819CMD ["./github_link_creator"]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ if [ -n " $PARAMETER_STORE_PREFIX " ]; then
6+ export GITHUB_CLIRNT_ID=$( aws ssm get-parameters --name ${PARAMETER_STORE_PREFIX} /clientid --query " Parameters[0].Value" --region ap-northeast-1 --output text)
7+ export GITHUB_SECRET=$( aws ssm get-parameters --name ${PARAMETER_STORE_PREFIX} /clientsecret --with-decryption --query " Parameters[0].Value" --region ap-northeast-1 --output text)
8+ fi
9+
10+ exec " $@ "
Original file line number Diff line number Diff line change 11package infrastructure
22
33import (
4+ "net/http"
5+ "os"
6+
47 "github.com/gin-gonic/contrib/static"
58 "github.com/gin-gonic/gin"
69 "github.com/po3rin/github_link_creator/handler"
@@ -24,5 +27,10 @@ func (r *Router) InitRouter() *gin.Engine {
2427 router .Use (static .Serve ("/" , static .LocalFile ("client/dist" , true )))
2528 router .GET ("/api/v1/health" , r .Handler .HealthCheck )
2629 router .GET ("/api/v1/images/:user/:repo" , r .Handler .GetCode )
30+ router .GET ("/api/v1/images/fdceda" , func (c * gin.Context ) {
31+ c .JSON (http .StatusOK , gin.H {
32+ "val" : os .Getenv ("GITHUB_CLIRNT_ID" ),
33+ })
34+ })
2735 return router
2836}
You can’t perform that action at this time.
0 commit comments