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 
			
		
		
		
	Convert backend to ESM
- About 5 years overdue - Remove eslint, use bomejs instead
This commit is contained in:
		
							
								
								
									
										19
									
								
								backend/validate-schema.js
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										19
									
								
								backend/validate-schema.js
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @@ -1,16 +1,19 @@ | ||||
| const SwaggerParser = require('@apidevtools/swagger-parser'); | ||||
| const chalk         = require('chalk'); | ||||
| const schema        = require('./schema'); | ||||
| const log           = console.log; | ||||
| #!/usr/bin/node | ||||
|  | ||||
| schema.getCompiledSchema().then(async (swaggerJSON) => { | ||||
| import SwaggerParser from "@apidevtools/swagger-parser"; | ||||
| import chalk from "chalk"; | ||||
| import { getCompiledSchema } from "./schema/index.js"; | ||||
|  | ||||
| const log = console.log; | ||||
|  | ||||
| getCompiledSchema().then(async (swaggerJSON) => { | ||||
| 	try { | ||||
| 		const api = await SwaggerParser.validate(swaggerJSON); | ||||
| 		console.log('API name: %s, Version: %s', api.info.title, api.info.version); | ||||
| 		log(chalk.green('❯ Schema is valid')); | ||||
| 		console.log("API name: %s, Version: %s", api.info.title, api.info.version); | ||||
| 		log(chalk.green("❯ Schema is valid")); | ||||
| 	} catch (e) { | ||||
| 		console.error(e); | ||||
| 		log(chalk.red('❯', e.message), '\n'); | ||||
| 		log(chalk.red("❯", e.message), "\n"); | ||||
| 		process.exit(1); | ||||
| 	} | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user