projects
/
recipes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update dependencies
[recipes.git]
/
backend
/
src
/
main.rs
diff --git
a/backend/src/main.rs
b/backend/src/main.rs
index
0536428
..
6d6b09a
100644
(file)
--- a/
backend/src/main.rs
+++ b/
backend/src/main.rs
@@
-13,6
+13,7
@@
use env_logger;
use itertools::Itertools;
mod consts;
use itertools::Itertools;
mod consts;
+mod db;
#[derive(Template)]
#[template(path = "main.html")]
#[derive(Template)]
#[template(path = "main.html")]
@@
-27,7
+28,7
@@
pub struct Request {
fn main_page(query: Query<Request>) -> Result<HttpResponse> {
fn main_page(query: Query<Request>) -> Result<HttpResponse> {
- let main_template = MainTemplate { test: &"
test
" };
+ let main_template = MainTemplate { test: &"
*** test ***
" };
let s = main_template.render().unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
let s = main_template.render().unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
@@
-59,6
+60,8
@@
fn main() -> std::io::Result<()> {
println!("Configuration: {:?}", config);
println!("Configuration: {:?}", config);
+ // let database_connection = db::create_or_update();
+
std::env::set_var("RUST_LOG", "actix_web=info");
env_logger::init();
std::env::set_var("RUST_LOG", "actix_web=info");
env_logger::init();
@@
-88,7
+91,7
@@
fn main() -> std::io::Result<()> {
fn process_args() -> bool {
fn print_usage() {
println!("Usage:");
fn process_args() -> bool {
fn print_usage() {
println!("Usage:");
- println!(" {} [--help]", get_exe_name());
+ println!(" {} [--help]
[--test]
", get_exe_name());
}
let args: Vec<String> = args().collect();
}
let args: Vec<String> = args().collect();
@@
-96,6
+99,9
@@
fn process_args() -> bool {
if args.iter().any(|arg| arg == "--help") {
print_usage();
return true
if args.iter().any(|arg| arg == "--help") {
print_usage();
return true
+ } else if args.iter().any(|arg| arg == "--test") {
+ let database_connection = db::create_or_update();
+ return true
}
false
}
false