sepia-search-motore-di-rice.../server/controllers/api/config.ts

24 lines
712 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
} as ServerConfig)
}