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

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 routes;
  18. mod schema;
  19. mod snippet;
  20. use crate::routes::static_rocket_route_info_for_create_snippet;
  21. use crate::routes::static_rocket_route_info_for_index;
  22. use crate::routes::static_rocket_route_info_for_show_snippet;
  23. fn main() {
  24. dotenv().ok();
  25. rocket::ignite()
  26. .attach(Template::fairing())
  27. .manage(connection::init_pool())
  28. .mount("/", routes![index, show_snippet, create_snippet])
  29. .launch();
  30. }