mirror of
https://github.com/Starlio-app/Starlio-web.git
synced 2024-12-26 02:03:46 +03:00
delete garbage
This commit is contained in:
parent
5312ea9f99
commit
35b4282ef2
1 changed files with 6 additions and 3 deletions
9
main.go
9
main.go
|
@ -26,7 +26,7 @@ func main() {
|
||||||
router.Use(func(next http.Handler) http.Handler {
|
router.Use(func(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
|
w.Header().Set("Access-Control-Allow-Methods", "POST, GET")
|
||||||
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
|
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
})
|
})
|
||||||
|
@ -36,16 +36,19 @@ func main() {
|
||||||
router.HandleFunc("/api/get/version", controllers.Version).Methods("GET")
|
router.HandleFunc("/api/get/version", controllers.Version).Methods("GET")
|
||||||
router.HandleFunc("/api/update/settings", controllers.SettingsUpdate).Methods("POST")
|
router.HandleFunc("/api/update/settings", controllers.SettingsUpdate).Methods("POST")
|
||||||
router.HandleFunc("/api/update/wallpaper", controllers.WallpaperUpdate).Methods("POST")
|
router.HandleFunc("/api/update/wallpaper", controllers.WallpaperUpdate).Methods("POST")
|
||||||
|
router.HandleFunc("/api/update/add/startapp", controllers.AddStartApp).Methods("POST")
|
||||||
|
router.HandleFunc("/api/update/del/startapp", controllers.RemoveStartApp).Methods("POST")
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
err := http.ListenAndServe(":8080", router)
|
err := http.ListenAndServe(":4662", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
err := http.ListenAndServe(":4662", nil)
|
err := http.ListenAndServe(":8080", router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue