mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Use FN_TOKEN not iron_token
This commit is contained in:
11
fn/api.go
11
fn/api.go
@@ -3,11 +3,12 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
httptransport "github.com/go-openapi/runtime/client"
|
|
||||||
"github.com/go-openapi/strfmt"
|
|
||||||
fnclient "github.com/funcy/functions_go/client"
|
|
||||||
"log"
|
"log"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
fnclient "github.com/funcy/functions_go/client"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
func host() string {
|
func host() string {
|
||||||
@@ -26,8 +27,8 @@ func host() string {
|
|||||||
|
|
||||||
func apiClient() *fnclient.Functions {
|
func apiClient() *fnclient.Functions {
|
||||||
transport := httptransport.New(host(), "/v1", []string{"http"})
|
transport := httptransport.New(host(), "/v1", []string{"http"})
|
||||||
if os.Getenv("IRON_TOKEN") != "" {
|
if os.Getenv("FN_TOKEN") != "" {
|
||||||
transport.DefaultAuthentication = httptransport.BearerToken(os.Getenv("IRON_TOKEN"))
|
transport.DefaultAuthentication = httptransport.BearerToken(os.Getenv("FN_TOKEN"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the API client, with the transport
|
// create the API client, with the transport
|
||||||
|
|||||||
Reference in New Issue
Block a user