Files
cabinet/assets/controllers/swaggerUI_controller.js
2026-05-28 12:09:28 +03:00

24 lines
661 B
JavaScript

import { Controller } from 'stimulus';
import "swagger-ui-dist/swagger-ui.css"
/*
* This is an example Stimulus controller!
*
* Any element with a data-controller="default" attribute will cause
* this controller to be executed. The name "default" comes from the filename:
* default_controller.js -> "default"
*
* Delete this file or adapt it for your use!
*/
export default class extends Controller {
connect() {
var SwaggerUIBundle = require('swagger-ui-dist').SwaggerUIBundle;
var wrap = this.element;
SwaggerUIBundle({
url: "/api/swagger.json",
dom_id: '#swagger-ui'
});
}
}