aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..f5fbd56
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,29 @@
+#![feature(proc_macro_hygiene, decl_macro)]
+
+#[macro_use] extern crate rocket;
+#[macro_use] extern crate serde_derive;
+extern crate rocket_contrib;
+extern crate serde_json;
+
+mod api;
+mod ui;
+mod db;
+
+use rocket_contrib::templates::Template;
+
+fn main() {
+ rocket::ignite()
+ .attach(Template::fairing())
+ .register(catchers![
+ ui::not_found
+ ])
+ .mount("/", routes![
+ ui::index,
+ ui::make_post,
+ ui::threads
+ ])
+ .mount("/api/v1/", routes![
+ api::post
+ ])
+ .launch();
+}