summaryrefslogtreecommitdiff
path: root/src/main.rs
blob: c085bfc7413813ffe95958a5fe9dfed0446afe1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#![feature(proc_macro_hygiene,decl_macro)]
#[macro_use]
extern crate rocket;
extern crate rocket_contrib;
extern crate regex;
extern crate chrono;

#[macro_use]
extern crate serde_derive;

//mod exchange;
mod parsers;
mod banking;
mod web_frontend;

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
	let asset_ini = "data/asset.ini";
	banking::asset::Asset::from_ini_file(asset_ini);
	rocket::ignite()
		.attach(Template::fairing())
		.mount("/", routes![web_frontend::transactions::transaction_handler,
		       web_frontend::balance::balance_handler, web_frontend::static_handler,
		       web_frontend::chart::chart_handler, web_frontend::asset::asset_handler])
		.launch();
}