@scalar/api-client
Version:
the open source API testing client
22 lines (21 loc) • 741 B
JavaScript
import { createApp as i } from "vue";
import { createRouter as o, createWebHistory as p, createWebHashHistory as c } from "vue-router";
import s from "../App.vue.js";
/* empty css */
import { ROUTES as a } from "./routes.js";
const n = (e) => e === "web" ? o({ history: p(), routes: a }) : o({ history: c(), routes: a }), h = (e, { layout: r = "desktop" }) => {
const t = i(s, { layout: r });
if (t.use(n(r)), !e) {
console.error(
"[@scalar/api-client-modal] Could not create the API client.",
"Invalid HTML element provided.",
"Read more: https://github.com/scalar/scalar/tree/main/packages/api-client"
);
return;
}
t.mount(e);
};
export {
h as createApiClientApp,
n as createAppRouter
};