The backend of a gist server written in Rust
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.rs 676B

1234567891011121314151617181920212223242526272829303132
  1. #![feature(proc_macro_hygiene, decl_macro)]
  2. #[macro_use]
  3. extern crate diesel;
  4. extern crate dotenv;
  5. extern crate r2d2;
  6. extern crate r2d2_diesel;
  7. #[macro_use]
  8. extern crate rocket;
  9. extern crate rocket_contrib;
  10. #[macro_use]
  11. extern crate serde_derive;
  12. use dotenv::dotenv;
  13. use rocket_contrib::templates::Template;
  14. mod connection;
  15. mod gists;
  16. mod routes;
  17. mod schema;
  18. use crate::routes::static_rocket_route_info_for_index;
  19. use crate::routes::static_rocket_route_info_for_show_gist;
  20. fn main() {
  21. dotenv().ok();
  22. rocket::ignite()
  23. .attach(Template::fairing())
  24. .manage(connection::init_pool())
  25. .mount("/", routes![index, show_gist])
  26. .launch();
  27. }