18 lines
355 B
Go
18 lines
355 B
Go
package api
|
|
|
|
import (
|
|
"Advertisement_Panel/db"
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
// move FileData and AsciiEntry here if you want, or leave in main.go
|
|
func FileHandler(w http.ResponseWriter, r *http.Request) {
|
|
var data []db.ImagesEntry
|
|
|
|
data = db.GetImageMetadata()
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
json.NewEncoder(w).Encode(data)
|
|
}
|