Skip to content
Snippets Groups Projects
Verified Commit 171cd46c authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Implement mutation APIs and prepare for implementing a new UI

parent ffe3b69d
No related branches found
No related tags found
1 merge request!1Replace entire project structure
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
package util
import "net/http"
func CorsWrapper(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
if r.Method == http.MethodOptions {
w.WriteHeader(200)
return
}
next.ServeHTTP(w, r)
})
}
package util
import "net/http"
func MethodOverride(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodPost {
method := r.PostFormValue("_method")
if method == "" {
method = r.Header.Get("X-HTTP-Method-Override")
}
if method == http.MethodPut ||
method == http.MethodPatch ||
method == http.MethodDelete {
r.Method = method
}
}
next.ServeHTTP(w, r)
})
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment