Skip to content

Navigation Menu

Sign in
Sign up

404 error #333

Unanswered
rpwatkins asked this question in Q&A
Apr 14, 2025 · 2 comments · 1 reply
Discussion options

Hello,

I am trying to embed riverui is my own web app, I have followed the directions on the web site. On my local dev machine, I use localhost port 4000 and am using the riverui prefix, But when I try to access the ui at localhost:4000/riverui, it returns a 404 error. I've tried to solve the problem myself, but am now stuck. Appreciate any help.

Thanks

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

Hi, is there any way you can share a full code sample? There's nothing to really go on here to be able to help.

You must be logged in to vote
0 replies
Comment options

Yes, I guess that isn't much help. I closely followed the documentation. Here is the initialiization:

// river ui
opts := &riverui.ServerOpts{
	Client: riverClient,
	DB: db,
	Logger: logger,
	Prefix: "/riverui", // mount the UI and its APIs under /riverui
}
riverServer, err := riverui.NewServer(opts)
if err != nil {
	log.Fatal(err)
}
// Start the server to initialize background processes for caching and periodic queries:
if err := riverServer.Start(ctx); err != nil {
	log.Fatal(err)
}

I assign the server to a variable on my application struct like so:

 app.riverServer: riverServer

Then I added the routes:

mux.Handle("/riverui", app.riverServer)

The only thing I do different than the documentation is the assignment of the riverServer to my app struct.

Sorry to be so unhelpful before.

Cheers,
Rod

You must be logged in to vote
1 reply
Comment options

Can you check the runnable example in #334? I suspect you'll find something different between its setup and yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /