-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
refactor: rewrite forge doc server using axum #6324
Conversation
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.
lgtm,
no need for warp, yes
for hotreloading, we could install watchexec with -w option
use tower_http::services::{ServeDir, ServeFile}; | ||
|
||
/// The HTTP endpoint for the websocket used to trigger reloads when a file changes. | ||
const LIVE_RELOAD_ENDPOINT: &str = "/__livereload"; |
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.
oh hell yeah,
I think for reloading we'd need a watch service that runs forge doc?
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.
This was half-implemented. I can open a follow up implementing this
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.
sweet,
I can't really remember how the watchexec API works, but I believe it was registering an action via a closure, maybe the forge watch command is helpful a reference, perhaps not
/// Open the documentation in a browser after serving. | ||
#[clap(long, requires = "serve")] | ||
open: bool, |
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.
amazing,
works
b584274
to
7fabaa2
Compare
Motivation
We're already using
axum
for Anvil, let's not use another one for no reason.Solution
forge
binary crate since it's pretty heavy dependency-wise.--open
to open the docs in a browser after serving them.