mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	add app hooks
This commit is contained in:
		
							parent
							
								
									dfa490affb
								
							
						
					
					
						commit
						ed5203d445
					
				@ -23,6 +23,11 @@ module.exports = function (config) {
 | 
			
		||||
    app.set('trust proxy');
 | 
			
		||||
    app.set('port', config.port);
 | 
			
		||||
    app.locals.baseUriPath = baseUriPath;
 | 
			
		||||
 | 
			
		||||
    if (typeof config.preHook === 'function') {
 | 
			
		||||
        config.preHook(app);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    app.use(cookieParser());
 | 
			
		||||
 | 
			
		||||
    if (publicFolder) {
 | 
			
		||||
@ -49,6 +54,10 @@ module.exports = function (config) {
 | 
			
		||||
        }));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (typeof config.preRouterHook === 'function') {
 | 
			
		||||
        config.preRouterHook(app);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Setup API routes
 | 
			
		||||
    const apiRouter = express.Router(); // eslint-disable-line new-cap
 | 
			
		||||
    routes.createAPI(apiRouter, config);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user