mirror of
https://codeberg.org/flpolyaplus/aplus.git
synced 2024-11-21 17:00:30 -05:00
exit if the CANVAS environment variables are not set
This commit is contained in:
parent
9221051dae
commit
8616d61555
2
aplus.go
2
aplus.go
@ -8,8 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
10
canvas.go
10
canvas.go
@ -15,8 +15,18 @@ import (
|
|||||||
|
|
||||||
func initialize() {
|
func initialize() {
|
||||||
instance_url := os.Getenv("CANVAS_INSTANCE")
|
instance_url := os.Getenv("CANVAS_INSTANCE")
|
||||||
|
if len(instance_url) == 0 {
|
||||||
|
fmt.Println("The CANVAS_INSTANCE environment variable seems to be empty. Exiting.")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
base_link = instance_url + "/api/v1"
|
base_link = instance_url + "/api/v1"
|
||||||
token = os.Getenv("CANVAS_API_KEY")
|
token = os.Getenv("CANVAS_API_KEY")
|
||||||
|
if len(token) == 0 {
|
||||||
|
fmt.Println("The CANVAS_API_KEY environment variable seems to be empty. Exiting.")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
jar, _ := cookiejar.New(&cookiejar.Options{
|
jar, _ := cookiejar.New(&cookiejar.Options{
|
||||||
PublicSuffixList: publicsuffix.List,
|
PublicSuffixList: publicsuffix.List,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user