Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@iodigital/vite-plugin-prism
Advanced tools
Prism, OpenAPI mocking server, integration for Vite
Prism, OpenAPI mocking server, integration for Vite
npm install --save-dev @iodigital/vite-plugin-prism
# yarn add --dev @iodigital/vite-plugin-prism
# pnpm add --save-dev @iodigital/vite-plugin-prism
// Import plugin
import prism from "@iodigital/vite-plugin-prism";
// Pass them to plugin
export default defineConfig({
plugins: [
prism([
{
// OpenAPI doc
specFilePathOrObject:
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml",
},
]),
],
});
import { defineNuxtConfig } from "nuxt";
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
modules: [
[
"@iodigital/vite-plugin-prism/dist/nuxt",
[
{
specFilePathOrObject:
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml",
},
],
],
],
// or
modules: ["@iodigital/vite-plugin-prism/dist/nuxt"],
prism: [
{
specFilePathOrObject:
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml",
},
],
});
interface PrismPluginOptions {
// Base path for API
// Default: /api
route?: string;
// URL to OpenAPI document or OpenAPI document object
specFilePathOrObject: string | object;
// Prism HTTP server configuration, same as Prism's IHttpConfig
// https://github.com/stoplightio/prism/tree/master/packages/http#config-object
// Default:
// {
// mock: { dynamic: true },
// validateRequest: true,
// validateResponse: true,
// checkSecurity: true,
// errors: true,
// };
prismConfig?: PrismConfig;
// Turn on Prism logging
// Default: false
debug?: boolean;
}
npm run dev
npm run build
cd examples/with-vite
npm run dev
curl http://localhost:3000/api/pets
npm run build
cd examples/with-nuxt
npm run dev
curl http://localhost:3000/api/pets
npm run build
FAQs
Prism, OpenAPI mocking server, integration for Vite
The npm package @iodigital/vite-plugin-prism receives a total of 238 weekly downloads. As such, @iodigital/vite-plugin-prism popularity was classified as not popular.
We found that @iodigital/vite-plugin-prism demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.