You've already forked nginx-proxy-manager
							
							
				mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-10-30 18:05:34 +03:00 
			
		
		
		
	- /schema now returns full openapi/swagger schema - That schema is used to validate incoming requests - And used as a contract in future integration tests - Moved route files up one level - Fixed incorrect 404 reponses when getting objects - Fixed saving new objects and passing jsonschemavalidation
		
			
				
	
	
		
			30 lines
		
	
	
		
			572 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			572 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const express        = require('express');
 | |
| const jwtdecode      = require('../lib/express/jwt-decode');
 | |
| const internalReport = require('../internal/report');
 | |
| 
 | |
| let router = express.Router({
 | |
| 	caseSensitive: true,
 | |
| 	strict:        true,
 | |
| 	mergeParams:   true
 | |
| });
 | |
| 
 | |
| router
 | |
| 	.route('/hosts')
 | |
| 	.options((_, res) => {
 | |
| 		res.sendStatus(204);
 | |
| 	})
 | |
| 
 | |
| 	/**
 | |
| 	 * GET /reports/hosts
 | |
| 	 */
 | |
| 	.get(jwtdecode(), (_, res, next) => {
 | |
| 		internalReport.getHostsReport(res.locals.access)
 | |
| 			.then((data) => {
 | |
| 				res.status(200)
 | |
| 					.send(data);
 | |
| 			})
 | |
| 			.catch(next);
 | |
| 	});
 | |
| 
 | |
| module.exports = router;
 |