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
add basic scaffold for web app #11
Conversation
What does one need to do to build and run this? |
I've added build instructions this also won't build on stable or beta due to rocket |
Can you rebase and squash this yourself to make the commit history less weird? :P |
The build instructions give this error:
|
I believe in clap you can group mutually exclusive options. So if |
I've been looking at the doc and i can't seem to find it |
I believe this will do what you want: https://docs.rs/clap/2.31.1/clap/struct.ArgGroup.html |
that's exactly what I'm looking for, thanks. |
src/main.rs
Outdated
extern crate clap; | ||
extern crate csv; | ||
extern crate env_logger; | ||
#[macro_use] | ||
extern crate failure; | ||
#[macro_use] | ||
#[macro_use(log, info, debug)] |
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.
I think this should be replaced by just #[macro_use(log)]
and then all logging macros are called as log::error!
etc.
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.
See rwf2/Rocket#109 (comment) for more info.
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.
I attempted this and got compiler errors in std.rs
failed to resolve. Not a module `log`
its possible I'm missing something
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.
i now see what i was missing
src/main.rs
Outdated
|
||
use std::io; | ||
|
||
use clap::{App, Arg}; | ||
use rocket_contrib::Template; | ||
|
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.
Nit: remove this newline and sort these alphabetically.
src/main.rs
Outdated
|
||
use failure::{Error, ResultExt}; | ||
use stv::*; | ||
use routes::*; |
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.
Nit: sort these alphabetically. failure should also be in the group above.
Add js and css for webapp, with stimulus, scss and webpack. Add rocket server, with handlebars Templating. Add build instructions.
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. I think we should definitely split up the CLI and server binaries soon though.
add stimulus for clientside app
rocket for api and file serving
handlebar templating
webpack to build js and scss