-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(backend): submit incident #39
Conversation
This is only for submitting incident right? |
yes |
looks good to me 👍🏼 |
backend/main.go
Outdated
@@ -53,6 +53,11 @@ func main() { | |||
port = "5000" | |||
} | |||
|
|||
apiKey, ok := os.LookupEnv("API_KEY") | |||
if !ok { | |||
log.Fatal().Msg("API_KEY is required") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be Fatal though. Should be a warning that the API_KEY
is not set, therefore you can't make API calls to endpoints that requires an API key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if incident.Timestamp.After(time.Now()) { | ||
incidentStatus = IncidentStatusScheduled | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Close #29
x-api-key
header for security. Therefore, you must addAPI_KEY
to the environment. Let me know, if you have a better solution.