mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-29 17:58:27 +00:00
api/core: update server info
Some checks are pending
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run tests / test service functionality (push) Waiting to run
Run tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Some checks are pending
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run tests / test service functionality (push) Waiting to run
Run tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
- cache server info as string - serve a list of services & duration limit in server info
This commit is contained in:
parent
7a557a97c3
commit
70264f3691
|
@ -42,13 +42,16 @@ export const runAPI = (express, app, __dirname) => {
|
|||
const startTime = new Date();
|
||||
const startTimestamp = startTime.getTime();
|
||||
|
||||
const serverInfo = {
|
||||
version: version,
|
||||
const serverInfo = JSON.stringify({
|
||||
cobalt: {
|
||||
version: version,
|
||||
url: env.apiURL,
|
||||
startTime: `${startTimestamp}`,
|
||||
durationLimit: env.durationLimit,
|
||||
services: [...env.enabledServices],
|
||||
},
|
||||
git,
|
||||
cors: env.corsWildcard,
|
||||
url: env.apiURL,
|
||||
startTime: `${startTimestamp}`,
|
||||
}
|
||||
})
|
||||
|
||||
const apiLimiter = rateLimit({
|
||||
windowMs: env.rateLimitWindow * 1000,
|
||||
|
@ -267,7 +270,8 @@ export const runAPI = (express, app, __dirname) => {
|
|||
})
|
||||
|
||||
app.get('/', (_, res) => {
|
||||
return res.status(200).json(serverInfo);
|
||||
res.type('json');
|
||||
res.status(200).send(serverInfo);
|
||||
})
|
||||
|
||||
app.get('/favicon.ico', (req, res) => {
|
||||
|
|
Loading…
Reference in a new issue