2020-08-27 14:44:21 +02:00
|
|
|
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,
|
2020-09-02 10:17:50 +02:00
|
|
|
indexedHostsCount: VideosIndexer.Instance.getIndexedHosts().length,
|
|
|
|
indexedInstancesUrl: CONFIG.INSTANCES_INDEX.PUBLIC_URL
|
2020-08-27 14:44:21 +02:00
|
|
|
} as ServerConfig)
|
|
|
|
}
|