The backend of a gist server written in Rust
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435
  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. extern crate syntect;
  14. use dotenv::dotenv;
  15. use rocket_contrib::templates::Template;
  16. mod connection;
  17. mod gists;
  18. mod routes;
  19. mod schema;
  20. use crate::routes::static_rocket_route_info_for_create_gist;
  21. use crate::routes::static_rocket_route_info_for_index;
  22. use crate::routes::static_rocket_route_info_for_show_gist;
  23. fn main() {
  24. dotenv().ok();
  25. rocket::ignite()
  26. .attach(Template::fairing())
  27. .manage(connection::init_pool())
  28. .mount("/", routes![index, show_gist, create_gist])
  29. .launch();
  30. }