mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Added option to disable legacy routes. Closes #244
This commit is contained in:
		
							parent
							
								
									eb346756d2
								
							
						
					
					
						commit
						6bc23f04da
					
				| @ -35,8 +35,9 @@ unleash.start({ | |||||||
| 
 | 
 | ||||||
| Available unleash options includes: | Available unleash options includes: | ||||||
| 
 | 
 | ||||||
| - databaseUrl  | - **databaseUrl** - the postgress database url to connect to. Should include username/password.  | ||||||
| - port | - **port** - Which port should the unleash-server bind to? | ||||||
|  | - **enableLegacyRoutes** (boolean) - allows you to turn on/off support for legacy routes to support older clients.  | ||||||
| 
 | 
 | ||||||
| ## How do I configure the log output? | ## How do I configure the log output? | ||||||
|   |   | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ const DEFAULT_OPTIONS = { | |||||||
|     port: process.env.HTTP_PORT || process.env.PORT || 4242, |     port: process.env.HTTP_PORT || process.env.PORT || 4242, | ||||||
|     baseUriPath: process.env.BASE_URI_PATH || '', |     baseUriPath: process.env.BASE_URI_PATH || '', | ||||||
|     serverMetrics: true, |     serverMetrics: true, | ||||||
|  |     enableLegacyRoutes: true, | ||||||
|     publicFolder, |     publicFolder, | ||||||
|     enableRequestLogger: isDev(), |     enableRequestLogger: isDev(), | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -38,7 +38,9 @@ exports.router = function(config) { | |||||||
|     // $root/features
 |     // $root/features
 | ||||||
|     // $root/client/register
 |     // $root/client/register
 | ||||||
|     // $root/client/metrics
 |     // $root/client/metrics
 | ||||||
|  |     if (config.enableLegacyRoutes) { | ||||||
|         router.use('/api/features', clientFeatures.router(config)); |         router.use('/api/features', clientFeatures.router(config)); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     return router; |     return router; | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -15,6 +15,7 @@ function getSetup() { | |||||||
|         baseUriPath: base, |         baseUriPath: base, | ||||||
|         stores, |         stores, | ||||||
|         eventBus, |         eventBus, | ||||||
|  |         enableLegacyRoutes: true, | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     return { |     return { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user