mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-10-30 23:33:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			521 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			521 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/node
 | ||
| 
 | ||
| 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"));
 | ||
| 	} catch (e) {
 | ||
| 		console.error(e);
 | ||
| 		log(chalk.red("❯", e.message), "\n");
 | ||
| 		process.exit(1);
 | ||
| 	}
 | ||
| });
 |