summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/main.rs b/src/main.rs
index 4c0768c..1325742 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,23 +1,29 @@
-mod exchange;
-mod Csv;
-//use exchange::Stock;
-use Csv::CsvFile;
+#![feature(proc_macro_hygiene,decl_macro)]
+#[macro_use]
+extern crate rocket;
+extern crate rocket_contrib;
+extern crate regex;
+extern crate chrono;
-fn main() {
- println!("Welcome to your investment calculator!");
+#[macro_use]
+extern crate serde_derive;
+
+//mod exchange;
+mod parsers;
+mod banking;
+mod web_frontend;
- // TODO Compute how the money would have benn developed on historical data
- //Stock::read_from_csv_file("~/hih");
- let config = CsvFile::read_file("test.csv", ";", true);
- let config = match config {
- Ok(c) => c,
- Err(error) => panic!("Error reading CSV file: {}", error),
- };
- let mut i = 0;
- for line in config.content {
- i += 1;
- for f in line {
- println!("{}: {}",i, f)
- }
- }
+use rocket_contrib::templates::Template;
+
+fn main() {
+ // handle command line parameters
+ // e.g. wheres is the asset config ini file
+ // TODO how pass config to the modules/handler ?
+ // launch web frontend
+ rocket::ignite()
+ .attach(Template::fairing())
+ .mount("/", routes![web_frontend::account_handler, web_frontend::transactions::transaction_handler,
+ web_frontend::transactions::transaction_handler_post,
+ web_frontend::balance::balance_handler, web_frontend::static_handler])
+ .launch();
}