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 771B

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