forked from OpenWF/SpaceNinjaServer
		
	feat: dynamic time for worldState (#138)
This commit is contained in:
		
							parent
							
								
									3225b71a41
								
							
						
					
					
						commit
						2d49006b5f
					
				@ -3,7 +3,9 @@ import config from "@/config.json";
 | 
				
			|||||||
import worldState from "@/static/fixed_responses/worldState.json";
 | 
					import worldState from "@/static/fixed_responses/worldState.json";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const worldStateController: RequestHandler = (_req, res) => {
 | 
					const worldStateController: RequestHandler = (_req, res) => {
 | 
				
			||||||
    res.json(worldState);
 | 
					    const state = worldState;
 | 
				
			||||||
 | 
					    state.Time = Math.round(Date.now() / 1000);
 | 
				
			||||||
 | 
					    res.json(state);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export { worldStateController };
 | 
					export { worldStateController };
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user