mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
Re-integrate examples into the root workspace (#1466)
Co-authored-by: David Pedersen <[email protected]>
This commit is contained in:
co-authored by
David Pedersen
parent
e7eda0e416
commit
dc480f7b0e
@@ -1,4 +0,0 @@
|
||||
[workspace]
|
||||
members = ["*"]
|
||||
exclude = ["async-graphql", "target"]
|
||||
resolver = "2"
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-anyhow-error-response
|
||||
//! cargo run -p example-anyhow-error-response
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-chat
|
||||
//! cargo run -p example-chat
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-consume-body-in-extractor-or-middleware
|
||||
//! cargo run -p example-consume-body-in-extractor-or-middleware
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-cors
|
||||
//! cargo run -p example-cors
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -12,5 +12,5 @@ already existing extractors
|
||||
Run with
|
||||
|
||||
```sh
|
||||
cd examples && cargo run -p example-customize-extractor-error
|
||||
cargo run -p example-customize-extractor-error
|
||||
```
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-customize-extractor-error
|
||||
//! cargo run -p example-customize-extractor-error
|
||||
//! ```
|
||||
|
||||
mod custom_extractor;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-customize-path-rejection
|
||||
//! cargo run -p example-customize-path-rejection
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-error-handling-and-dependency-injection
|
||||
//! cargo run -p example-error-handling-and-dependency-injection
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-form
|
||||
//! cargo run -p example-form
|
||||
//! ```
|
||||
|
||||
use axum::{extract::Form, response::Html, routing::get, Router};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-global-404-handler
|
||||
//! cargo run -p example-global-404-handler
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-graceful-shutdown
|
||||
//! cargo run -p example-graceful-shutdown
|
||||
//! kill or ctrl-c
|
||||
//! ```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-handle-head-request
|
||||
//! cargo run -p example-handle-head-request
|
||||
//! ```
|
||||
|
||||
use axum::response::{IntoResponse, Response};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-hello-world
|
||||
//! cargo run -p example-hello-world
|
||||
//! ```
|
||||
|
||||
use axum::{response::Html, routing::get, Router};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-hyper-1-0
|
||||
//! cargo run -p example-hyper-1-0
|
||||
//! ```
|
||||
|
||||
use axum::{routing::get, Router};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! Run with:
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-key-value-store
|
||||
//! cargo run -p example-key-value-store
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-low-level-rustls
|
||||
//! cargo run -p example-low-level-rustls
|
||||
//! ```
|
||||
|
||||
use axum::{extract::ConnectInfo, routing::get, Router};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-multipart-form
|
||||
//! cargo run -p example-multipart-form
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-parse-body-based-on-content-type
|
||||
//! cargo run -p example-parse-body-based-on-content-type
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-print-request-response
|
||||
//! cargo run -p example-print-request-response
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-prometheus-metrics
|
||||
//! cargo run -p example-prometheus-metrics
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-query-params-with-empty-strings
|
||||
//! cargo run -p example-query-params-with-empty-strings
|
||||
//! ```
|
||||
|
||||
use axum::{extract::Query, routing::get, Router};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-readme
|
||||
//! cargo run -p example-readme
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-rest-grpc-multiplex
|
||||
//! cargo run -p example-rest-grpc-multiplex
|
||||
//! ```
|
||||
|
||||
use self::multiplex_service::MultiplexService;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-reverse-proxy
|
||||
//! cargo run -p example-reverse-proxy
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-routes-and-handlers-close-together
|
||||
//! cargo run -p example-routes-and-handlers-close-together
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-sessions
|
||||
//! cargo run -p example-sessions
|
||||
//! ```
|
||||
|
||||
use async_session::{MemoryStore, Session, SessionStore as _};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-simple-router-wasm
|
||||
//! cargo run -p example-simple-router-wasm
|
||||
//! ```
|
||||
//!
|
||||
//! This example shows what using axum in a wasm context might look like. This example should
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-sqlx-postgres
|
||||
//! cargo run -p example-sqlx-postgres
|
||||
//! ```
|
||||
//!
|
||||
//! Test with curl:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-sse
|
||||
//! cargo run -p example-sse
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples/static-file-server && cargo run -p example-static-file-server
|
||||
//! cargo run -p example-static-file-server
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-stream-to-file
|
||||
//! cargo run -p example-stream-to-file
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-templates
|
||||
//! cargo run -p example-templates
|
||||
//! ```
|
||||
|
||||
use askama::Template;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-tls-rustls
|
||||
//! cargo run -p example-tls-rustls
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-todos
|
||||
//! cargo run -p example-todos
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-tokio-postgres
|
||||
//! cargo run -p example-tokio-postgres
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-tracing-aka-logging
|
||||
//! cargo run -p example-tracing-aka-logging
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-unix-domain-socket
|
||||
//! cargo run -p example-unix-domain-socket
|
||||
//! ```
|
||||
|
||||
#[cfg(unix)]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-validator
|
||||
//! cargo run -p example-validator
|
||||
//!
|
||||
//! curl '127.0.0.1:3000?name='
|
||||
//! -> Input validation error: [name: Can not be empty]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Run with
|
||||
//!
|
||||
//! ```not_rust
|
||||
//! cd examples && cargo run -p example-versioning
|
||||
//! cargo run -p example-versioning
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
|
||||
Reference in New Issue
Block a user