Skip to content

Commit

Permalink
fix: change how fly runs this app
Browse files Browse the repository at this point in the history
  • Loading branch information
arpitdalal committed Apr 20, 2024
1 parent c2c125e commit 487db46
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 16 deletions.
55 changes: 39 additions & 16 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
# fly.toml app configuration file generated for arpit-im-shortner on 2024-04-20T15:20:17-04:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'arpit-im-shortner'
primary_region = 'yyz'
kill_signal = "SIGINT"
kill_timeout = 5
processes = [ ]

[experimental]
allowed_public_ports = [ ]
auto_rollback = true

[[services]]
internal_port = 3000
processes = [ "app" ]
protocol = "tcp"
script_checks = [ ]

[build]
[services.concurrency]
hard_limit = 100
soft_limit = 80
type = "requests"

[http_service]
internal_port = 3000
[[services.ports]]
handlers = [ "http" ]
port = 80
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
[[services.ports]]
handlers = [ "tls", "http" ]
port = 443

[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"

[[services.http_checks]]
interval = "10s"
grace_period = "5s"
method = "get"
path = "/healthcheck"
protocol = "http"
timeout = "2s"
tls_skip_verify = false
headers = { }
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ app.get("/linkedin", (_, res) => {
res.redirect(URLS.linkedin);
});

app.get("/healthcheck", (_, res) => {
res.send("OK");
});

app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});

0 comments on commit 487db46

Please sign in to comment.