Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
created() {
const route = _.defaultsDeep(mixinOptions.routeOptions, {
use: [
ApiGateway.serveStatic(SwaggerUI.absolutePath())
],
aliases: {
"GET /openapi.json"(req, res) {
// Send back the generated schema
if (shouldUpdateSchema || !schema) {
// Create new server & regenerate GraphQL schema
this.logger.info("♻ Regenerate OpenAPI/Swagger schema...");
try {
schema = this.generateOpenAPISchema();
shouldUpdateSchema = false;
this.logger.debug(schema);
/**
* Static routes
*/
{
path: "/",
use: [
// handle fallback for HTML5 history API
require("connect-history-api-fallback")(),
// Webpack middlewares
...initWebpackMiddlewares(),
// Serve static
ApiGateway.serveStatic("./static"),
],
// Action aliases
aliases: {
},
mappingPolicy: "restrict",
},
]
},
methods: {
/**
* Authenticate from request
*
* @param {Context} ctx