File tree Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Expand file tree Collapse file tree 4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,6 @@ export default function baseUrlHandler(
5
5
res : Response ,
6
6
next : NextFunction
7
7
) : void {
8
- res . conf . baseUrlFunc =
9
- res . conf . baseUrlFunc ||
10
- ( typeof res . conf . baseUrl === 'function' ? res . conf . baseUrl : undefined ) ;
11
-
12
8
if ( res . conf . baseUrlFunc ) {
13
9
res . conf . baseUrl = res . conf . baseUrlFunc ( {
14
10
host : req . headers . host ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import getAvailableDependencies from './helpers/get-available-dependencies';
4
4
5
5
export default function dependencies ( conf : Config ) {
6
6
return function ( req : Request , res : Response ) : void {
7
- if ( conf . discovery ) {
7
+ if ( res . conf . discovery ) {
8
8
const dependencies = getAvailableDependencies ( conf . dependencies ) . map (
9
9
( { core, name, version } ) => {
10
10
const dep : { name : string ; core : boolean ; versions ?: string [ ] } = {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { Config } from '../../types';
3
3
4
4
export default function plugins ( conf : Config ) {
5
5
return ( req : Request , res : Response ) : void => {
6
- if ( conf . discovery ) {
6
+ if ( res . conf . discovery ) {
7
7
const plugins = Object . entries ( conf . plugins ) . map (
8
8
( [ pluginName , pluginFn ] ) => ( {
9
9
name : pluginName ,
Original file line number Diff line number Diff line change @@ -116,9 +116,9 @@ export interface VM {
116
116
export interface Config {
117
117
beforePublish : ( req : Request , res : Response , next : NextFunction ) => void ;
118
118
baseUrl : string ;
119
- baseUrlFunc : ( opts : { host ?: string ; secure : boolean } ) => string ;
119
+ baseUrlFunc ? : ( opts : { host ?: string ; secure : boolean } ) => string ;
120
120
discovery : boolean ;
121
- discoveryFunc : ( opts : { host ?: string ; secure : boolean } ) => boolean ;
121
+ discoveryFunc ? : ( opts : { host ?: string ; secure : boolean } ) => boolean ;
122
122
plugins : Record < string , ( ...args : unknown [ ] ) => void > ;
123
123
local : boolean ;
124
124
tempDir : string ;
You can’t perform that action at this time.
0 commit comments