mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
Update scripts for new location
This commit is contained in:
parent
d268d939eb
commit
ef66e1c8df
8 changed files with 26 additions and 20 deletions
|
@ -8,13 +8,8 @@ import (
|
|||
)
|
||||
|
||||
func importImage(uuid string, url string) error {
|
||||
// Create the file
|
||||
path, err := os.Getwd()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
out, err := os.Create(path + string(os.PathSeparator) + StaticDirectory + string(os.PathSeparator) + "img" + string(os.PathSeparator) + uuid + "_full.jpg")
|
||||
// Create image
|
||||
out, err := os.Create(DataDirectory + string(os.PathSeparator) + "img" + string(os.PathSeparator) + uuid + "_full.jpg")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -22,8 +22,9 @@ type jsonResponse struct {
|
|||
// List of Reverse proxies
|
||||
var ReverseProxies []string
|
||||
|
||||
// Static image directory
|
||||
var StaticDirectory string
|
||||
// Directories
|
||||
var FrontendDirectory string
|
||||
var DataDirectory string
|
||||
|
||||
// RequestRequest - Incoming JSON!
|
||||
type RequestRequest struct {
|
||||
|
@ -96,14 +97,14 @@ func HandleRequests(port string) {
|
|||
r.PathPrefix("/api")
|
||||
|
||||
// SERVE STATIC FILES - NO AUTH
|
||||
spaStatic := spaStaticHandler{staticPath: StaticDirectory}
|
||||
spaStatic := spaStaticHandler{staticPath: DataDirectory}
|
||||
r.PathPrefix("/img").Handler(spaStatic)
|
||||
|
||||
apiDocs := spaStaticHandler{staticPath: "docs/api/build"}
|
||||
r.PathPrefix("/docs").Handler(apiDocs)
|
||||
|
||||
// SERVE FRONTEND - NO AUTH
|
||||
spa := spaHandler{staticPath: "web/build", indexPath: "index.html"}
|
||||
spa := spaHandler{staticPath: FrontendDirectory + string(os.PathSeparator) + "build", indexPath: "index.html"}
|
||||
r.PathPrefix("/").Handler(spa)
|
||||
|
||||
c := cors.New(cors.Options{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue