Skip to content

Commit

Permalink
fix echo service and friend
Browse files Browse the repository at this point in the history
  • Loading branch information
glendc committed Mar 19, 2024
1 parent cf90674 commit fbe02ec
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@ jobs:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
deploy-rama-echo:
runs-on: ubuntu-latest
needs: deploy-rama-fp-docker
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: |
cd rama-fp/infra/deployments/echo
flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
deploy-rama-echo:
runs-on: ubuntu-latest
needs: deploy-rama-fp-docker
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: |
cd rama-fp/infra/deployments/echo
flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 22 additions & 10 deletions rama-fp/infra/deployments/echo/fly.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
# fly.toml app configuration file generated for rama-echo on 2024-03-19T23:16:07+01:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'rama-echo'
primary_region = 'lhr'

[build]
image = "glendc/rama-fp:latest"

[experimental]
cmd = ["./rama-fp", "-i", "0.0.0.0", "-p", "8080", "--http-version", "auto", "echo"]
cmd = [
'./rama-fp',
'-i',
'0.0.0.0',
'-p',
'8080',
'--http-version',
'auto',
'echo',
]

[build]
image = 'glendc/rama-fp:latest'

[[services]]
protocol = 'tcp'
internal_port = 8080
protocol = "tcp"
force_https = false
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
processes = ['app']

[[services.ports]]
port = "80"
port = 80

[[services]]
protocol = 'tcp'
internal_port = 8443
protocol = "tcp"
force_https = false
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
processes = ['app']

[[services.ports]]
port = "443"
port = 443

[[vm]]
memory = '256mb'
Expand Down
5 changes: 4 additions & 1 deletion rama-fp/src/service/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,10 @@ pub async fn get_assets_script() -> Response {
pub async fn echo(ctx: Context<State>, req: Request) -> Json<serde_json::Value> {
let http_info: super::data::HttpInfo = get_http_info(&req);

let query_params = req.uri().query().and_then(|q| serde_urlencoded::from_str::<HashMap<String, String>>(q).ok());
let query_params = req
.uri()
.query()
.and_then(|q| serde_urlencoded::from_str::<HashMap<String, String>>(q).ok());

let (parts, body) = req.into_parts();

Expand Down
2 changes: 1 addition & 1 deletion rama-fp/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ pub async fn echo(cfg: Config) -> anyhow::Result<()> {
endpoints::get_acme_challenge,
)
// Echo
.not_found(endpoints::echo)
.not_found(endpoints::echo),
);

let tcp_service_builder = ServiceBuilder::new()
Expand Down

0 comments on commit fbe02ec

Please sign in to comment.