mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-04-01 02:42:23 -05:00
fix: add missing version on footer #3671
This commit is contained in:
parent
ccfac8f0aa
commit
b85ba995b5
2 changed files with 6 additions and 9 deletions
|
@ -27,6 +27,8 @@ import apiEndpoint from './endpoint';
|
|||
import { errorReportingMiddleware, handleError, serveFavicon } from './middleware';
|
||||
import webMiddleware from './web';
|
||||
|
||||
const { version } = require('../../package.json');
|
||||
|
||||
export function loadTheme(config) {
|
||||
if (_.isNil(config.theme) === false) {
|
||||
return _.head(
|
||||
|
@ -103,6 +105,10 @@ const defineAPI = function (config: IConfig, storage: IStorageHandler): any {
|
|||
|
||||
// For WebUI & WebUI API
|
||||
if (_.get(config, 'web.enable', true)) {
|
||||
app.use((_req, res, next) => {
|
||||
res.locals.app_version = version ?? '';
|
||||
next();
|
||||
});
|
||||
app.use('/', webMiddleware(config, auth, storage));
|
||||
} else {
|
||||
app.get('/', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
const path = require('path');
|
||||
|
||||
const APP_ROOT = path.resolve(__dirname, '../../');
|
||||
|
||||
module.exports = {
|
||||
APP_ROOT,
|
||||
SRC_ROOT: path.resolve(APP_ROOT, 'src/'),
|
||||
DIST_PATH: path.resolve(APP_ROOT, 'static/'),
|
||||
};
|
Loading…
Add table
Reference in a new issue