feature(freetracker): landing requests
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				platform/multy-stub/pipeline/head This commit looks good
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	platform/multy-stub/pipeline/head This commit looks good
				
			This commit is contained in:
		
							parent
							
								
									3d52ef9d4c
								
							
						
					
					
						commit
						552457b5cb
					
				| @ -1,5 +1,6 @@ | |||||||
| const router = require('express').Router(); | const router = require('express').Router(); | ||||||
| 
 | 
 | ||||||
| router.use('/performer', require('./dashboard-performer')) | router.use('/performer', require('./dashboard-performer')) | ||||||
|  | router.use('/landing', require('./landing')) | ||||||
| 
 | 
 | ||||||
| module.exports = router; | module.exports = router; | ||||||
							
								
								
									
										29
									
								
								server/routers/freetracker/landing/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								server/routers/freetracker/landing/index.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,29 @@ | |||||||
|  | const Router = require('express').Router; | ||||||
|  | 
 | ||||||
|  | const router = Router() | ||||||
|  | 
 | ||||||
|  | const values = { | ||||||
|  |   'blocks': 'success', | ||||||
|  |   'application': 'success' | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | const timer = (_req, _res, next) => { | ||||||
|  |   setTimeout(() => next(), 500) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | router.use(timer) | ||||||
|  | 
 | ||||||
|  | router.get( | ||||||
|  |   '/blocks', | ||||||
|  |   (req, res) => | ||||||
|  |     res.send(require(`./json/blocks-${values['blocks']}.json`)) | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | router.post( | ||||||
|  |   '/application', | ||||||
|  |   (req, res) => { | ||||||
|  |     res.send(require(`./json/application-${values['application']}.json`)) | ||||||
|  |   } | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | module.exports = router | ||||||
| @ -0,0 +1,7 @@ | |||||||
|  | { | ||||||
|  |   "success": false, | ||||||
|  |   "body": { }, | ||||||
|  |   "errors": [ | ||||||
|  |     "Что-то пошло не так" | ||||||
|  |   ] | ||||||
|  | } | ||||||
| @ -0,0 +1,4 @@ | |||||||
|  | { | ||||||
|  |   "success": true, | ||||||
|  |   "body": { } | ||||||
|  | } | ||||||
| @ -0,0 +1,9 @@ | |||||||
|  | { | ||||||
|  |   "success": false, | ||||||
|  |   "body": { | ||||||
|  |     "blocks": [] | ||||||
|  |   }, | ||||||
|  |   "errors": [ | ||||||
|  |     "Что-то пошло не так" | ||||||
|  |   ] | ||||||
|  | } | ||||||
							
								
								
									
										22
									
								
								server/routers/freetracker/landing/json/blocks-success.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								server/routers/freetracker/landing/json/blocks-success.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | |||||||
|  | { | ||||||
|  |   "success": true, | ||||||
|  |   "body": { | ||||||
|  |     "blocks": [ | ||||||
|  |       { | ||||||
|  |         "titleKey":"block1.title", | ||||||
|  |         "textKey":"block1.subtitle", | ||||||
|  |         "imageName":"truck1" | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         "titleKey":"block2.title", | ||||||
|  |         "textKey":"block2.subtitle", | ||||||
|  |         "imageName":"truck2" | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         "titleKey":"block3.title", | ||||||
|  |         "textKey":"block3.subtitle", | ||||||
|  |         "imageName":"truck3" | ||||||
|  |       } | ||||||
|  |     ] | ||||||
|  |   } | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user