More API refactoring and working on cleaning up
Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
parent
e4323b6047
commit
3b41c9dd5f
9 changed files with 232 additions and 148 deletions
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
token="c558cccdd25917056e8b7b72a2a3e5f40215d707a6fac1aa"
|
||||
server="localhost"
|
||||
port="8080"
|
||||
|
||||
function photoget() {
|
||||
url="http://${server}:${port}/${1}"
|
||||
curl --header "X-Session-Id: ${token}" --header "Content-Type: application/json" ${url}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
token=""
|
||||
server="localhost"
|
||||
port="8080"
|
||||
|
||||
function photoget() {
|
||||
url="http://${server}:${port}/${1}"
|
||||
curl --header "X-Session-Id: ${token}" --header "Content-Type: application/json" ${url} | jq
|
||||
}
|
|
@ -7,9 +7,8 @@ import (
|
|||
|
||||
func main() {
|
||||
logger.Level = 4
|
||||
creds := photoprism.NewClientAuthLogin("admin", "missy")
|
||||
client := photoprism.New("localhost:8080")
|
||||
err := client.Auth(creds)
|
||||
client := photoprism.New("http://localhost:8080")
|
||||
err := client.Auth(photoprism.NewClientAuthLogin("admin", "missy"))
|
||||
if err != nil {
|
||||
halt(4, "Error logging into API: %v", err)
|
||||
}
|
||||
|
|
|
@ -11,9 +11,8 @@ import (
|
|||
func main() {
|
||||
logger.Level = 4
|
||||
uuid := "pqnzigq351j2fqgn" // This is a known ID
|
||||
creds := photoprism.NewClientAuthLogin("admin", "missy")
|
||||
client := photoprism.New("localhost:8080")
|
||||
err := client.Auth(creds)
|
||||
client := photoprism.New("http://localhost:8080")
|
||||
err := client.Auth(photoprism.NewClientAuthLogin("admin", "missy"))
|
||||
if err != nil {
|
||||
halt(4, "Error logging into API: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue