wissance / gwuu Goto Github PK
View Code? Open in Web Editor NEWGo web development extension over gorilla/mux and gorm
Home Page: https://wissance.github.io/gwuu/
License: Apache License 2.0
Go web development extension over gorilla/mux and gorm
Home Page: https://wissance.github.io/gwuu/
License: Apache License 2.0
Sometimes cors middleware is not working as a quick solution we should add decorator function for handling CORS req (it should set Access-Control-Allow-Origin value to required one)
Unfortunately i found following issue - we have not access to gorm module from gwuu package -> gwuu.gorm. Also properly set top module name and version because when i import gwuu i see in go.sum:
github.com/wissance/gwuu v0.0.0-20210315093816-2fd5013531a2 h1:0NItVqNOuPTMSdSPosLjUnCvGU0DmJNpkHIpRARkq/o=
github.com/wissance/gwuu v0.0.0-20210315093816-2fd5013531a2/go.mod h1:Z+GbE6rxlJPQ1V2eQ+U2msaHRCmgQ91G4ST8ggZ9BKI=
But it should look like:
github.com/wissance/gwuu v1.0 ....
When we 100% sure that database does not exists we could skip database check (this will speed up database works especially with frequent database creation (in tests))
We should create help functions for comparison primitive data types:
Change test function to be generic
Add gorilla mux functions that allows to properly use CORS
charset, content-type & so on we don't want to set manually
This PR reproduces the issue - #17 (test)
func TestHandleFuncForSubRouterSameName(t *testing.T) {
internalSubNet := "192.168.30.0"
handler := NewWebApiHandler(true, internalSubNet)
objectResource := "/api/object/"
handler.HandleFunc(handler.Router, objectResource, func(writer http.ResponseWriter, request *http.Request) {
}, "GET")
service1Router := handler.Router.PathPrefix("/service1").Subrouter()
handler.HandleFunc(service1Router, objectResource, func(writer http.ResponseWriter, request *http.Request) {
}, "POST")
checkOptionRouteCors(t, handler.Router, "/api/object/", internalSubNet, "*", "OPTIONS,GET")
checkOptionRouteCors(t, handler.Router, "/service1/api/object/", internalSubNet, "*", "OPTIONS,POST")
}
add possibility to pass such a option
For proper application that use gorm we we should pass config
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.