-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gnoweb): rework & Implement new gnoweb design #3195
base: master
Are you sure you want to change the base?
Changes from 69 commits
af2112b
f4f3a86
f3dbbf3
5dd673d
997ab46
a112a63
5e13369
a97d66d
e53bbb4
611e315
2eaee06
550055e
3f4a4bb
60243f6
d08528b
7c48c36
f7d708a
f6687ed
d2345da
b6e36a9
3b6369e
a95b5de
801f1ba
d1fe542
037e451
8cea3ea
555ac1c
7a80b4f
b39b8a1
b1e06f3
8db8d7e
dd88c32
d4b1210
6e9622f
cff3730
58da650
fc8ac17
c20a99b
c2b691c
7a38df7
33b333b
43f7880
cf4b3d8
a683c96
547c4e8
45276d6
58d9efc
b95890a
e044ad9
0a5c720
84ea845
a970aa9
36bbcb0
3fcbdb6
0e8bf5e
0ed44b3
f0bde45
2e9f3cb
4c3f6a1
3445f52
b93ae3d
d3a0af7
203c5fe
d4d8645
28dac08
bc52d9b
d97f08f
949e90b
db88955
9e90280
ac19ef6
cbd3cd9
db59650
4b1dd8a
3ef80b2
00e6ec4
657ad8b
89724ab
cbc4f9b
f93398f
5140676
50ab259
0a310bf
e04b399
d3ad8dd
0d5f98f
12e6ba3
7993dc7
5997c24
23d83d9
b135f5a
023ca5b
3962d83
92b8c87
92af050
fb93d14
142f74e
c981ce2
870d481
ecd873f
edceea3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,27 +1,30 @@ | ||||||
package main | ||||||
|
||||||
import ( | ||||||
"fmt" | ||||||
"log/slog" | ||||||
"net/http" | ||||||
|
||||||
gnodev "github.com/gnolang/gno/contribs/gnodev/pkg/dev" | ||||||
"github.com/gnolang/gno/gno.land/pkg/gnoweb" | ||||||
gnoweb "github.com/gnolang/gno/gno.land/pkg/gnoweb" | ||||||
Check failure on line 9 in contribs/gnodev/cmd/gnodev/setup_web.go GitHub Actions / Run Main (gnodev) / Go Linter / lint
Check failure on line 9 in contribs/gnodev/cmd/gnodev/setup_web.go GitHub Actions / Run Main (gnodev) / Go Linter / lint
Check failure on line 9 in contribs/gnodev/cmd/gnodev/setup_web.go GitHub Actions / Run Main (gnodev) / Go Linter / lint
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
) | ||||||
|
||||||
// setupGnowebServer initializes and starts the Gnoweb server. | ||||||
func setupGnoWebServer(logger *slog.Logger, cfg *devCfg, dnode *gnodev.Node) http.Handler { | ||||||
webConfig := gnoweb.NewDefaultConfig() | ||||||
func setupGnoWebServer(logger *slog.Logger, cfg *devCfg, dnode *gnodev.Node) (http.Handler, error) { | ||||||
remote := dnode.GetRemoteAddress() | ||||||
|
||||||
webConfig.HelpChainID = cfg.chainId | ||||||
webConfig.RemoteAddr = dnode.GetRemoteAddress() | ||||||
webConfig.HelpRemote = cfg.webRemoteHelperAddr | ||||||
webConfig.WithHTML = cfg.webWithHTML | ||||||
appcfg := gnoweb.NewDefaultAppConfig() | ||||||
appcfg.UnsafeHTML = cfg.webHTML | ||||||
appcfg.NodeRemote = remote | ||||||
appcfg.ChainID = cfg.chainId | ||||||
if cfg.webRemoteHelperAddr != "" { | ||||||
appcfg.RemoteHelp = cfg.webRemoteHelperAddr | ||||||
} | ||||||
|
||||||
// If `HelpRemote` is empty default it to `RemoteAddr` | ||||||
if webConfig.HelpRemote == "" { | ||||||
webConfig.HelpRemote = webConfig.RemoteAddr | ||||||
router, err := gnoweb.NewRouter(logger, appcfg) | ||||||
if err != nil { | ||||||
return nil, fmt.Errorf("unable to create router app: %w", err) | ||||||
} | ||||||
|
||||||
app := gnoweb.MakeApp(logger, webConfig) | ||||||
return app.Router | ||||||
return router, nil | ||||||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you tackle it in this PR? shouldn't be complex, no?