Stub RPC
This commit is contained in:
parent
5fe90e57eb
commit
f7f62c35d2
2 changed files with 20 additions and 2 deletions
|
@ -16,6 +16,7 @@ mod entities;
|
||||||
mod dns;
|
mod dns;
|
||||||
mod util;
|
mod util;
|
||||||
mod routes;
|
mod routes;
|
||||||
|
mod rpc;
|
||||||
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
||||||
|
@ -68,8 +69,6 @@ async fn main() {
|
||||||
|
|
||||||
info!("Starting web server...");
|
info!("Starting web server...");
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/", get(routes::status::status))
|
|
||||||
|
|
||||||
// Auth
|
// Auth
|
||||||
.route("/user/register", post(routes::auth::register::register))
|
.route("/user/register", post(routes::auth::register::register))
|
||||||
.route("/user/login", post(routes::auth::login::login))
|
.route("/user/login", post(routes::auth::login::login))
|
||||||
|
@ -85,6 +84,12 @@ async fn main() {
|
||||||
|
|
||||||
// Proxies
|
// Proxies
|
||||||
|
|
||||||
|
// RPC
|
||||||
|
.route("/rpc", post(rpc::rpc))
|
||||||
|
|
||||||
|
// Misc
|
||||||
|
.route("/", get(routes::status::status))
|
||||||
|
|
||||||
.layer(
|
.layer(
|
||||||
ServiceBuilder::new()
|
ServiceBuilder::new()
|
||||||
.layer(Extension(connection))
|
.layer(Extension(connection))
|
||||||
|
|
13
src/rpc/mod.rs
Normal file
13
src/rpc/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
use std::net::SocketAddr;
|
||||||
|
use axum::Extension;
|
||||||
|
use axum::extract::ConnectInfo;
|
||||||
|
use axum::http::StatusCode;
|
||||||
|
use axum::response::IntoResponse;
|
||||||
|
use sea_orm::DatabaseConnection;
|
||||||
|
|
||||||
|
pub async fn rpc(
|
||||||
|
Extension(ref connection): Extension<DatabaseConnection>,
|
||||||
|
ConnectInfo(addr): ConnectInfo<SocketAddr>,
|
||||||
|
) -> impl IntoResponse{
|
||||||
|
(StatusCode::INTERNAL_SERVER_ERROR, "NOT IMPLEMENTED")
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue