wip: added get post comments, working insert comment to post

This commit is contained in:
2024-09-27 23:17:33 -04:00
parent c303e6aaee
commit 8128459b4e
4 changed files with 69 additions and 30 deletions

View File

@ -55,7 +55,7 @@ async fn main() {
)
.init();
if std::env::var("RUST_ENV").expect("development") != "development" {
if std::env::var("RUST_ENV").unwrap_or_else(|_| "development".to_string()) != "development" {
println!("we're not in development, starting up the rate limiter");
let governor_conf = Arc::new(
GovernorConfigBuilder::default()
@ -97,11 +97,11 @@ async fn main() {
TraceLayer::new_for_http()
.make_span_with(trace::DefaultMakeSpan::new().level(tracing::Level::INFO))
.on_response(trace::DefaultOnResponse::new().level(tracing::Level::INFO)),
)
.nest(
"/comments",
routes::comments::CommentsRoute::routes(&app_state),
);
// .nest(
// "/comments",
// routes::comments::CommentsRoute::routes(&app_state),
// );
// run it with hyper
let listener = TcpListener::bind("0.0.0.0:3000").await.unwrap();