The backend of a gist server written in Rust
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

main.rs 832B

123456789101112131415161718192021222324252627282930313233343536
  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 htmlescape;
  7. extern crate r2d2;
  8. extern crate r2d2_diesel;
  9. #[macro_use]
  10. extern crate rocket;
  11. extern crate rocket_contrib;
  12. #[macro_use]
  13. extern crate serde_derive;
  14. extern crate syntect;
  15. use dotenv::dotenv;
  16. use rocket_contrib::templates::Template;
  17. mod connection;
  18. mod routes;
  19. mod schema;
  20. mod snippet;
  21. use crate::routes::static_rocket_route_info_for_create_snippet;
  22. use crate::routes::static_rocket_route_info_for_index;
  23. use crate::routes::static_rocket_route_info_for_show_snippet;
  24. fn main() {
  25. dotenv().ok();
  26. rocket::ignite()
  27. .attach(Template::fairing())
  28. .manage(connection::init_pool())
  29. .mount("/", routes![index, show_snippet, create_snippet])
  30. .launch();
  31. }