mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-06 00:00:17 +02:00
Rename to axum (#28)
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
- [`form`](../examples/form.rs) - Receiving data from an HTML `<form>`.
|
||||
- [`static_file_server`](../examples/static_file_server.rs) - Serving static files from a directory. Could for example be the baseline for a single page app.
|
||||
- [`templates`](../examples/templates.rs) - Rending HTML templates using [askama](https://crates.io/crates/askama).
|
||||
- [`testing`](../examples/testing.rs) - How to test awebframework apps.
|
||||
- [`testing`](../examples/testing.rs) - How to test axum apps.
|
||||
- [`versioning`](../examples/versioning.rs) - How one might version an API.
|
||||
- [`websocket`](../examples/websocket.rs) - How to build an app that handles WebSocket connections.
|
||||
- [`error_handling_and_dependency_injection`](../examples/error_handling_and_dependency_injection.rs) - How to handle errors and dependency injection using trait objects.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
use awebframework::{
|
||||
use axum::{
|
||||
async_trait,
|
||||
extract::{Extension, Json, UrlParams},
|
||||
prelude::*,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
use awebframework::prelude::*;
|
||||
use axum::prelude::*;
|
||||
use serde::Deserialize;
|
||||
use std::net::SocketAddr;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use awebframework::prelude::*;
|
||||
use axum::prelude::*;
|
||||
use std::net::SocketAddr;
|
||||
|
||||
#[tokio::main]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Simple in-memory key/value store showing features of awebframework.
|
||||
//! Simple in-memory key/value store showing features of axum.
|
||||
//!
|
||||
//! Run with:
|
||||
//!
|
||||
@@ -6,7 +6,7 @@
|
||||
//! RUST_LOG=tower_http=debug,key_value_store=trace cargo run --example key_value_store
|
||||
//! ```
|
||||
|
||||
use awebframework::{
|
||||
use axum::{
|
||||
extract::{ContentLengthLimit, Extension, UrlParams},
|
||||
prelude::*,
|
||||
response::IntoResponse,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use awebframework::{prelude::*, service::ServiceExt};
|
||||
use axum::{prelude::*, service::ServiceExt};
|
||||
use http::StatusCode;
|
||||
use std::net::SocketAddr;
|
||||
use tower_http::{services::ServeDir, trace::TraceLayer};
|
||||
@@ -7,9 +7,9 @@ use tower_http::{services::ServeDir, trace::TraceLayer};
|
||||
async fn main() {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let app = awebframework::routing::nest(
|
||||
let app = axum::routing::nest(
|
||||
"/static",
|
||||
awebframework::service::get(ServeDir::new(".").handle_error(|error: std::io::Error| {
|
||||
axum::service::get(ServeDir::new(".").handle_error(|error: std::io::Error| {
|
||||
(
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("Unhandled interal error: {}", error),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use askama::Template;
|
||||
use awebframework::{prelude::*, response::IntoResponse};
|
||||
use axum::{prelude::*, response::IntoResponse};
|
||||
use http::{Response, StatusCode};
|
||||
use std::net::SocketAddr;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
use awebframework::{prelude::*, routing::BoxRoute};
|
||||
use axum::{prelude::*, routing::BoxRoute};
|
||||
use tower_http::trace::TraceLayer;
|
||||
|
||||
#[tokio::main]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use awebframework::{extract::Extension, prelude::*, AddExtensionLayer};
|
||||
use axum::{extract::Extension, prelude::*, AddExtensionLayer};
|
||||
use bb8::Pool;
|
||||
use bb8_postgres::PostgresConnectionManager;
|
||||
use http::StatusCode;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use awebframework::response::IntoResponse;
|
||||
use awebframework::{async_trait, extract::FromRequest, prelude::*};
|
||||
use axum::response::IntoResponse;
|
||||
use axum::{async_trait, extract::FromRequest, prelude::*};
|
||||
use http::Response;
|
||||
use http::StatusCode;
|
||||
use std::net::SocketAddr;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//! --example websocket
|
||||
//! ```
|
||||
|
||||
use awebframework::{
|
||||
use axum::{
|
||||
prelude::*,
|
||||
routing::nest,
|
||||
service::ServiceExt,
|
||||
@@ -29,7 +29,7 @@ async fn main() {
|
||||
// build our application with some routes
|
||||
let app = nest(
|
||||
"/",
|
||||
awebframework::service::get(
|
||||
axum::service::get(
|
||||
ServeDir::new("examples/websocket")
|
||||
.append_index_html_on_directories(true)
|
||||
.handle_error(|error: std::io::Error| {
|
||||
|
||||
Reference in New Issue
Block a user