Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
ec8d0b5ebc
commit
74ea9ddf79
@ -1,3 +1,2 @@
|
||||
[workspace]
|
||||
|
||||
members = ["src/cmd/scel", "src/lib/scel_core", "src/lib/scel_api"]
|
||||
members = ["crates/*"]
|
||||
|
@ -12,5 +12,5 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
anyhow = { version = "1.0.66" }
|
||||
dotenv = { version = "*" }
|
||||
|
||||
scel_api = { path = "../../lib/scel_api" }
|
||||
scel_core = { path = "../../lib/scel_core" }
|
||||
scel_api = { path = "../scel_api" }
|
||||
scel_core = { path = "../scel_core" }
|
@ -22,7 +22,7 @@ use axum::{
|
||||
use graphql::{
|
||||
mutation::MutationRoot, query::QueryRoot, schema::ScelSchema, subscription::SubscriptionRoot,
|
||||
};
|
||||
use hyper::{client::HttpConnector, Body, StatusCode, Uri};
|
||||
use reqwest::StatusCode;
|
||||
use scel_core::App;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tower_http::{
|
||||
@ -49,8 +49,6 @@ pub struct Server {
|
||||
addr: SocketAddr,
|
||||
}
|
||||
|
||||
type Client = hyper::client::Client<HttpConnector, Body>;
|
||||
|
||||
impl Server {
|
||||
pub fn new(app: Arc<App>) -> Server {
|
||||
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))
|
||||
.layer(Extension(schema))
|
||||
.layer(Extension(MemoryStore::new()))
|
||||
.layer(Extension(Client::new()))
|
||||
.layer(Extension(auth::oauth_client()))
|
||||
.layer(
|
||||
CorsLayer::new()
|
||||
@ -93,9 +90,7 @@ impl Server {
|
||||
)
|
||||
.layer(TraceLayer::new_for_http().make_span_with(DefaultMakeSpan::default()));
|
||||
|
||||
let app = Router::new()
|
||||
.nest("/api", api_router)
|
||||
.fallback(svc)
|
||||
let app = Router::new().nest("/api", api_router);
|
||||
|
||||
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
|
||||
|
0
src/web/.gitignore → web/.gitignore
vendored
0
src/web/.gitignore → web/.gitignore
vendored
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Loading…
Reference in New Issue
Block a user