mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-06-10 03:06:49 +00:00
watchexec & breaking changes in axum 0.8
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
[tools]
|
||||
pnpm = "11.5.0"
|
||||
rust = "1.95"
|
||||
watchexec = "latest"
|
||||
# Node loaded below from .nvmrc
|
||||
|
||||
[settings]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"private": true,
|
||||
"name": "@cryptgeon/backend",
|
||||
"scripts": {
|
||||
"dev": "cargo watch -x 'run --bin cryptgeon'",
|
||||
"dev": "watchexec -r -e rs cargo run",
|
||||
"build": "cargo build --release",
|
||||
"test:server": "SIZE_LIMIT=10MiB LISTEN_ADDR=0.0.0.0:3000 cargo run",
|
||||
"test:prepare": "cargo build"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use axum::{
|
||||
Router, ServiceExt,
|
||||
extract::{DefaultBodyLimit, Request},
|
||||
routing::{delete, get, post},
|
||||
Router, ServiceExt,
|
||||
};
|
||||
use dotenv::dotenv;
|
||||
use lock::SharedState;
|
||||
@@ -41,14 +41,14 @@ async fn main() {
|
||||
|
||||
let notes_routes = Router::new()
|
||||
.route("/", post(note::create))
|
||||
.route("/:id", delete(note::delete))
|
||||
.route("/:id", get(note::preview));
|
||||
.route("/{id}", delete(note::delete))
|
||||
.route("/{id}", get(note::preview));
|
||||
let health_routes = Router::new().route("/live", get(health::report_health));
|
||||
let status_routes = Router::new().route("/status", get(status::get_status));
|
||||
let api_routes = Router::new()
|
||||
.nest("/notes", notes_routes)
|
||||
.nest("/", health_routes)
|
||||
.nest("/", status_routes);
|
||||
.merge(health_routes)
|
||||
.merge(status_routes);
|
||||
|
||||
let index = format!("{}{}", config::FRONTEND_PATH.to_string(), "/index.html");
|
||||
let serve_dir =
|
||||
|
||||
Reference in New Issue
Block a user