Skip to content

Commit

Permalink
hotfix: wrong hardcoded env variable (#14)
Browse files Browse the repository at this point in the history
* hotfix: wrong hardcoded env variable

* fix: modified
  • Loading branch information
thesuzerain authored Jul 16, 2024
1 parent c4b1649 commit ab92f94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- master
pull_request:
branches:
- master

jobs:
docker:
Expand All @@ -31,6 +33,6 @@ jobs:
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
2 changes: 1 addition & 1 deletion crates/machete-app/src/fetch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ lazy_static::lazy_static! {
}
// TODO: Is there a coherent way to make this into an environment variable, given WASM?
// WASI may be an option
pub const SERVER_URL: &str = "http://localhost:4200";
pub const SERVER_URL: &str = "https://www.wyattverchere.com";

// TODO: Alternating use of ?Send or not may not be the correct way to handle this
#[cfg_attr(feature = "offline", async_trait)]
Expand Down
6 changes: 1 addition & 5 deletions crates/machete-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ pub async fn run_server() {
let pool = database::connect().await.unwrap();
log::info!("Connected to database");

let cors = CorsLayer::new()
.allow_methods([Method::GET, Method::POST])
.allow_origin(tower_http::cors::Any);

// build our application with a route
let app = Router::new()
// `GET /` goes to `root`
Expand All @@ -37,7 +33,7 @@ pub async fn run_server() {
.route("/items", get(get_items))
.route("/spells", get(get_spells))
.with_state(pool)
.layer(ServiceBuilder::new().layer(cors));
.layer(ServiceBuilder::new().layer(CorsLayer::permissive()));

// run our app with hyper, listening globally on port 3000
let bind_addr = dotenvy::var("BIND_URL").expect("BIND_URL must be set");
Expand Down

0 comments on commit ab92f94

Please sign in to comment.