terraform deploy on ECS (#27)

This commit is contained in:
David Zhao
2021-02-28 22:28:17 -08:00
committed by GitHub
parent 7b93e661f0
commit f7af7607b9
17 changed files with 444 additions and 21 deletions
+1 -19
View File
@@ -55,6 +55,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// require a claim
if claims == nil || claims.Video == nil {
handleError(w, http.StatusUnauthorized, rtc.ErrPermissionDenied.Error())
return
}
identity := claims.Identity
@@ -170,22 +171,3 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}
}
type errStruct struct {
StatusCode int `json:"statusCode"`
Error string `json:"error"`
Message string `json:"message,omitempty"`
}
func jsonError(code int, error ...string) errStruct {
es := errStruct{
StatusCode: code,
}
if len(error) > 0 {
es.Error = error[0]
}
if len(error) > 1 {
es.Message = error[1]
}
return es
}