2020-01-04 21:59:57 +00:00
|
|
|
'use strict'
|
|
|
|
|
2020-01-04 22:30:23 +00:00
|
|
|
const realtime = require('../realtime/realtime')
|
|
|
|
const config = require('../config')
|
2020-01-04 21:59:57 +00:00
|
|
|
|
|
|
|
exports.getStatus = async (req, res) => {
|
|
|
|
const data = await realtime.getStatus()
|
|
|
|
|
|
|
|
res.set({
|
|
|
|
'Cache-Control': 'private', // only cache by client
|
|
|
|
'X-Robots-Tag': 'noindex, nofollow', // prevent crawling
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
})
|
|
|
|
res.send(data)
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.getConfig = (req, res) => {
|
|
|
|
const data = {
|
|
|
|
domain: config.domain,
|
|
|
|
urlpath: config.urlPath,
|
|
|
|
debug: config.debug,
|
|
|
|
version: config.fullversion,
|
|
|
|
plantumlServer: config.plantuml.server,
|
|
|
|
DROPBOX_APP_KEY: config.dropbox.appKey,
|
|
|
|
allowedUploadMimeTypes: config.allowedUploadMimeTypes,
|
|
|
|
defaultUseHardbreak: config.defaultUseHardbreak,
|
|
|
|
linkifyHeaderStyle: config.linkifyHeaderStyle
|
|
|
|
}
|
|
|
|
res.set({
|
|
|
|
'Cache-Control': 'private', // only cache by client
|
|
|
|
'X-Robots-Tag': 'noindex, nofollow', // prevent crawling
|
|
|
|
'Content-Type': 'application/javascript'
|
|
|
|
})
|
|
|
|
res.render('../js/lib/common/constant.ejs', data)
|
|
|
|
}
|