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