feat: update
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-04-10 20:50:48 +02:00
parent ec8d0b5ebc
commit 74ea9ddf79
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
35 changed files with 5 additions and 11 deletions

View File

@ -1,3 +1,2 @@
[workspace] [workspace]
members = ["crates/*"]
members = ["src/cmd/scel", "src/lib/scel_core", "src/lib/scel_api"]

View File

@ -12,5 +12,5 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
anyhow = { version = "1.0.66" } anyhow = { version = "1.0.66" }
dotenv = { version = "*" } dotenv = { version = "*" }
scel_api = { path = "../../lib/scel_api" } scel_api = { path = "../scel_api" }
scel_core = { path = "../../lib/scel_core" } scel_core = { path = "../scel_core" }

View File

@ -22,7 +22,7 @@ use axum::{
use graphql::{ use graphql::{
mutation::MutationRoot, query::QueryRoot, schema::ScelSchema, subscription::SubscriptionRoot, mutation::MutationRoot, query::QueryRoot, schema::ScelSchema, subscription::SubscriptionRoot,
}; };
use hyper::{client::HttpConnector, Body, StatusCode, Uri}; use reqwest::StatusCode;
use scel_core::App; use scel_core::App;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use tower_http::{ use tower_http::{
@ -49,8 +49,6 @@ pub struct Server {
addr: SocketAddr, addr: SocketAddr,
} }
type Client = hyper::client::Client<HttpConnector, Body>;
impl Server { impl Server {
pub fn new(app: Arc<App>) -> Server { pub fn new(app: Arc<App>) -> Server {
let schema = Schema::build(QueryRoot, MutationRoot, SubscriptionRoot) let schema = Schema::build(QueryRoot, MutationRoot, SubscriptionRoot)
@ -83,7 +81,6 @@ impl Server {
.fallback(get_service(ServeDir::new("./src/web/dist/")).handle_error(handle_error)) .fallback(get_service(ServeDir::new("./src/web/dist/")).handle_error(handle_error))
.layer(Extension(schema)) .layer(Extension(schema))
.layer(Extension(MemoryStore::new())) .layer(Extension(MemoryStore::new()))
.layer(Extension(Client::new()))
.layer(Extension(auth::oauth_client())) .layer(Extension(auth::oauth_client()))
.layer( .layer(
CorsLayer::new() CorsLayer::new()
@ -93,9 +90,7 @@ impl Server {
) )
.layer(TraceLayer::new_for_http().make_span_with(DefaultMakeSpan::default())); .layer(TraceLayer::new_for_http().make_span_with(DefaultMakeSpan::default()));
let app = Router::new() let app = Router::new().nest("/api", api_router);
.nest("/api", api_router)
.fallback(svc)
let addr = SocketAddr::from(([0, 0, 0, 0], 3000)); let addr = SocketAddr::from(([0, 0, 0, 0], 3000));

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB