1
0
mirror of https://framagit.org/framasoft/peertube/search-index/ synced 2024-12-13 17:46:16 +01:00
sepia-search-motore-di-rice.../server/controllers/api/config.ts
2020-09-02 10:20:39 +02:00

25 lines
772 B
TypeScript

import * as express from 'express'
import { VideosIndexer } from '../../lib/schedulers/videos-indexer'
import { ServerConfig } from '../../../shared'
import { CONFIG } from '../../initializers/constants'
const configRouter = express.Router()
configRouter.get('/config',
getConfig
)
// ---------------------------------------------------------------------------
export { configRouter }
// ---------------------------------------------------------------------------
async function getConfig (req: express.Request, res: express.Response) {
return res.json({
searchInstanceName: CONFIG.SEARCH_INSTANCE.NAME,
indexedHostsCount: VideosIndexer.Instance.getIndexedHosts().length,
indexedInstancesUrl: CONFIG.INSTANCES_INDEX.PUBLIC_URL
} as ServerConfig)
}