chore: standardize service domains and error logging
Build and Push Docker Images / detect-changes (push) Successful in 15s
Build and Push Docker Images / build-auth-api (push) Successful in 1m2s
Build and Push Docker Images / build-employee-api (push) Successful in 1m2s
Build and Push Docker Images / build-transit-api (push) Successful in 1m2s
Build and Push Docker Images / build-error-log-api (push) Successful in 1m10s
Build and Push Docker Images / build-admin-ui (push) Successful in 1m22s
Build and Push Docker Images / deploy-test-node (push) Successful in 4s
Build and Push Docker Images / detect-changes (push) Successful in 15s
Build and Push Docker Images / build-auth-api (push) Successful in 1m2s
Build and Push Docker Images / build-employee-api (push) Successful in 1m2s
Build and Push Docker Images / build-transit-api (push) Successful in 1m2s
Build and Push Docker Images / build-error-log-api (push) Successful in 1m10s
Build and Push Docker Images / build-admin-ui (push) Successful in 1m22s
Build and Push Docker Images / deploy-test-node (push) Successful in 4s
This commit is contained in:
@@ -53,7 +53,7 @@ Note: `ADMIN_USER_CODES` has been moved to the `auth_api` service. Configure adm
|
||||
npm start
|
||||
```
|
||||
|
||||
API draait op `http://localhost:5001`
|
||||
API draait op `https://transit.xtransit.testinstance.nl`
|
||||
|
||||
## API Endpoints
|
||||
|
||||
@@ -154,7 +154,7 @@ De legacy endpoint **GET** `/schedules` blijft beschikbaar voor bestaande client
|
||||
Voorbeeld:
|
||||
|
||||
```bash
|
||||
curl "http://localhost:5001/schedules/overview?date=2026-05-06&chauffeurId=12&busStopId=3"
|
||||
curl "https://transit.xtransit.testinstance.nl/schedules/overview?date=2026-05-06&chauffeurId=12&busStopId=3"
|
||||
```
|
||||
|
||||
### Navigation
|
||||
|
||||
@@ -10,7 +10,8 @@ app.use(express.json());
|
||||
app.use(cors());
|
||||
|
||||
const ERROR_LOG_API_URL =
|
||||
process.env.ERROR_LOG_API_URL || "http://localhost:5003/error_log";
|
||||
process.env.ERROR_LOG_API_URL ||
|
||||
"https://error.xtransit.testinstance.nl/error_log";
|
||||
|
||||
function friendlyErrorMessage(statusCode) {
|
||||
if (statusCode === 400) return "Controleer je invoer en probeer opnieuw.";
|
||||
@@ -20,14 +21,14 @@ function friendlyErrorMessage(statusCode) {
|
||||
return "Er ging iets mis. Probeer het later opnieuw.";
|
||||
}
|
||||
|
||||
async function reportError({ partOfService, error }) {
|
||||
async function reportError({ partofservice, error }) {
|
||||
try {
|
||||
await fetch(ERROR_LOG_API_URL, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
service: "transit_api",
|
||||
partOfService,
|
||||
partofservice,
|
||||
error,
|
||||
}),
|
||||
});
|
||||
@@ -41,7 +42,7 @@ app.use((req, res, next) => {
|
||||
const rawError =
|
||||
body.error || body.message || body.details || `HTTP ${res.statusCode}`;
|
||||
void reportError({
|
||||
partOfService: `${req.method} ${req.originalUrl}`,
|
||||
partofservice: `${req.method} ${req.originalUrl}`,
|
||||
error: rawError,
|
||||
});
|
||||
return originalJson({ error: friendlyErrorMessage(res.statusCode) });
|
||||
|
||||
Reference in New Issue
Block a user