bug fix for fly server
This commit is contained in:
parent
b3dcec17c0
commit
0defbfea5a
10 changed files with 33 additions and 21 deletions
|
|
@ -7,26 +7,39 @@ app = 'db-assignment-service'
|
|||
primary_region = 'sea'
|
||||
|
||||
[build]
|
||||
# Only needed if you're using a Dockerfile — can be empty if using buildpacks or Node preset
|
||||
|
||||
[http_service]
|
||||
internal_port = 3000
|
||||
force_https = true
|
||||
auto_stop_machines = 'stop'
|
||||
auto_start_machines = true
|
||||
min_machines_running = 0
|
||||
processes = ['app']
|
||||
# Removed the [http_service] section to disable public HTTP/HTTPS access
|
||||
# [http_service]
|
||||
# internal_port = 3000
|
||||
# force_https = true
|
||||
# auto_stop_machines = true
|
||||
# auto_start_machines = true
|
||||
# min_machines_running = 0
|
||||
# processes = ["app"]
|
||||
|
||||
[[services]]
|
||||
protocol = 'tcp'
|
||||
protocol = "tcp"
|
||||
internal_port = 3000
|
||||
ports = []
|
||||
internal_only = true # Makes this service only accessible internally
|
||||
auto_start_machines = true
|
||||
auto_stop_machines = true
|
||||
|
||||
# Removed public port exposure
|
||||
# [[services.ports]]
|
||||
# port = 80
|
||||
# handlers = ["http"]
|
||||
|
||||
# [[services.ports]]
|
||||
# port = 443
|
||||
# handlers = ["tls", "http"]
|
||||
|
||||
[services.concurrency]
|
||||
type = 'requests'
|
||||
type = "requests"
|
||||
hard_limit = 1000
|
||||
soft_limit = 500
|
||||
|
||||
[[vm]]
|
||||
memory = '1gb'
|
||||
cpu_kind = 'shared'
|
||||
cpu_kind = "shared"
|
||||
cpus = 1
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
#DB_ASSIGNMENT_SERVICE_URL = "http://localhost:3000"
|
||||
DB_ASSIGNMENT_SERVICE_URL = "http://db-assignment-service.internal:3000"
|
||||
NODE_PORT = 8080
|
||||
|
|
@ -3,4 +3,4 @@ NODE_ENV=development
|
|||
DB_ASSIGNMENT_SERVICE_URL="http://localhost:3200"
|
||||
AUTH_SESSION_KEY="f3f4d8e6b17a4b3abdc8e9a2c0457aaf91c0d5f6e3b7a9c8df624bd71ea35f42"
|
||||
ACCEPTED_ORIGINS=http://localhost:3000,http://localhost:8081,http://localhost:3001,http://localhost:5173
|
||||
PORT=8082
|
||||
NODE_PORT=8082
|
||||
|
|
@ -3,4 +3,4 @@ NODE_ENV=development
|
|||
DB_ASSIGNMENT_SERVICE_URL="http://js-assignment-db-service:3200"
|
||||
AUTH_SESSION_KEY="f3f4d8e6b17a4b3abdc8e9a2c0457aaf91c0d5f6e3b7a9c8df624bd71ea35f42"
|
||||
ACCEPTED_ORIGINS=http://localhost:3000,http://localhost:8081,http://localhost:3001,http://localhost:5173
|
||||
PORT=8082
|
||||
NODE_PORT=8082
|
||||
|
|
@ -39,5 +39,5 @@ app.use(cors());
|
|||
app.use("/instructor", instructorRouter);
|
||||
app.use("/student", studentRouter);
|
||||
|
||||
const port = process.env.PORT || 8080;
|
||||
const port = process.env.NODE_PORT || 8080;
|
||||
app.listen(port, () => console.log(`Listening on port ${port}...`));
|
||||
|
|
@ -6,6 +6,7 @@ ACCEPTED_ORIGINS ="https://bytecamp-web.fly.dev,https://byte-camp-auth-service.f
|
|||
#DB_USER_SERVICE_URL = "http://localhost:3000/"
|
||||
DB_USER_SERVICE_URL = "http://db-user-service.internal:3000/"
|
||||
AUTH_SESSION_KEY = "f3f4d8e6b17a4b3abdc8e9a2c0457aaf91c0d5f6e3b7a9c8df624bd71ea35f42"
|
||||
ASSIGNMENT_SERVICE_URL="http://assignment-service.internal:8080"
|
||||
|
||||
# fly secrets set GOOGLE_CALLBACK_URL=https://byte-camp-auth-service.fly.dev/auth/google/callback
|
||||
#fly secrets set GOOGLE_CLIENT_ID=485880105639-1in8tvb6ondnn198rasuj2d8ank06ntp.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=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 LOGIN_REDIRECT_URL=https://bytecamp-web.fly.dev/ DB_USER_SERVICE_URL=https://db-user-service.fly.dev:3000/ AUTH_SESSION_KEY=f3f4d8e6b17a4b3abdc8e9a2c0457aaf91c0d5f6e3b7a9c8df624bd71ea35f42
|
||||
|
|
@ -5,6 +5,7 @@ GOOGLE_CLIENT_SECRET="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"
|
|||
GOOGLE_CALLBACK_URL="http://localhost:8080/auth/google/callback"
|
||||
LOGIN_REDIRECT_URL="http://localhost:5173/"
|
||||
ACCEPTED_ORIGINS=http://localhost:3000,http://localhost:8081,http://localhost:3001,http://localhost:5173
|
||||
ASSIGNMENT_SERVICE_URL="http://localhost:8082/"
|
||||
DB_USER_SERVICE_URL="http://localhost:3100/"
|
||||
AUTH_SESSION_KEY="f3f4d8e6b17a4b3abdc8e9a2c0457aaf91c0d5f6e3b7a9c8df624bd71ea35f42"
|
||||
PORT=8080
|
||||
|
|
@ -31,7 +31,7 @@ passport.use(
|
|||
try {
|
||||
console.log("Sending request to external auth service...");
|
||||
const response = await axios.post(
|
||||
"http://localhost:8082/student/verify",
|
||||
`${process.env.ASSIGNMENT_SERVICE_URL}/student/verify`,
|
||||
{
|
||||
assignmentId,
|
||||
password,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ app.use(
|
|||
})
|
||||
)
|
||||
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
app.use("/auth", authRoute);
|
||||
|
|
|
|||
|
|
@ -6,11 +6,6 @@ primary_region = "sea"
|
|||
[build]
|
||||
# Only needed if you're using a Dockerfile — can be empty if using buildpacks or Node preset
|
||||
|
||||
#[env]
|
||||
#NODE_ENV = "production"
|
||||
#DATABASE_URL = "postgresql://user:password@hostname:port/dbname"
|
||||
# you can also leave DATABASE_URL unset here and use secrets instead
|
||||
|
||||
# Removed the [http_service] section to disable public HTTP/HTTPS access
|
||||
# [http_service]
|
||||
# internal_port = 3000
|
||||
|
|
@ -24,6 +19,8 @@ primary_region = "sea"
|
|||
protocol = "tcp"
|
||||
internal_port = 3000
|
||||
internal_only = true # Makes this service only accessible internally
|
||||
auto_start_machines = true
|
||||
auto_stop_machines = true
|
||||
|
||||
# Removed public port exposure
|
||||
# [[services.ports]]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue