mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 00:43:58 +08:00
New Docs (#3034)
* New Docs CSS update and Dockerfile to include docs folder flash of unrendered text fix markdown docs ignore docs/docs.go improving the docs generation github actions for docs generation go runner version fix updated docs.yml update repo action updated updated actions and dns docs dns complete More docs update Complete docs and updated workflow Update documentation Tue Aug 6 11:17:42 UTC 2024 Update documentation Thu Aug 8 12:26:57 UTC 2024 clean up clean up Dockerfile clean up Updated workflow Updated workflow Update docs.yml Update docs.yml * requested changes * changed ingress gateway to remote access gateway
This commit is contained in:
@@ -35,7 +35,6 @@ var HttpHandlers = []interface{}{
|
||||
legacyHandlers,
|
||||
}
|
||||
|
||||
// HandleRESTRequests - handles the rest requests
|
||||
func HandleRESTRequests(wg *sync.WaitGroup, ctx context.Context) {
|
||||
defer wg.Done()
|
||||
|
||||
@@ -43,9 +42,19 @@ func HandleRESTRequests(wg *sync.WaitGroup, ctx context.Context) {
|
||||
|
||||
// Currently allowed dev origin is all. Should change in prod
|
||||
// should consider analyzing the allowed methods further
|
||||
headersOk := handlers.AllowedHeaders([]string{"Access-Control-Allow-Origin", "X-Requested-With", "Content-Type", "authorization", "From-Ui"})
|
||||
headersOk := handlers.AllowedHeaders(
|
||||
[]string{
|
||||
"Access-Control-Allow-Origin",
|
||||
"X-Requested-With",
|
||||
"Content-Type",
|
||||
"authorization",
|
||||
"From-Ui",
|
||||
},
|
||||
)
|
||||
originsOk := handlers.AllowedOrigins(strings.Split(servercfg.GetAllowedOrigin(), ","))
|
||||
methodsOk := handlers.AllowedMethods([]string{http.MethodGet, http.MethodPut, http.MethodPost, http.MethodDelete})
|
||||
methodsOk := handlers.AllowedMethods(
|
||||
[]string{http.MethodGet, http.MethodPut, http.MethodPost, http.MethodDelete},
|
||||
)
|
||||
|
||||
for _, middleware := range HttpMiddlewares {
|
||||
r.Use(middleware)
|
||||
@@ -57,7 +66,10 @@ func HandleRESTRequests(wg *sync.WaitGroup, ctx context.Context) {
|
||||
|
||||
port := servercfg.GetAPIPort()
|
||||
|
||||
srv := &http.Server{Addr: ":" + port, Handler: handlers.CORS(originsOk, headersOk, methodsOk)(r)}
|
||||
srv := &http.Server{
|
||||
Addr: ":" + port,
|
||||
Handler: handlers.CORS(originsOk, headersOk, methodsOk)(r),
|
||||
}
|
||||
go func() {
|
||||
err := srv.ListenAndServe()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user