WEB UI microservice: fallback to index.html for non-existent resource.
This commit is contained in:
		
							parent
							
								
									b49bf05e45
								
							
						
					
					
						commit
						9eee7634c4
					
				@ -99,7 +99,12 @@ let connections: Socket[] = [];
 | 
			
		||||
 | 
			
		||||
        const root = path.join(webDir, 'public');
 | 
			
		||||
 | 
			
		||||
        app.use(express.static(root));
 | 
			
		||||
        const staticServe = express.static(root);
 | 
			
		||||
 | 
			
		||||
        app.use(staticServe);
 | 
			
		||||
        app.use((req, res, next) => {
 | 
			
		||||
           res.sendFile(path.join(root, 'index.html'));
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        server.listen(bindPort, bindAddress, () => {
 | 
			
		||||
            logger.info('==> 🌎  Listening on port %s.', bindPort);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user