@cpro-js/vite-ui5-mockserver-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Vite UI5 Mockserver Plugin

Integrates @sap-ux/fe-mockserver-core into Vite and reloads your application on mock data changes.

The SAP Fiori - UI5 middleware for the Fiori elements mock server is a middleware extension.... As an alternative to proxying OData requests to a live backend, it supports loading mock data for OData v2/v4 requests for supported Fiori elements templates. As the mock server runs locally without requiring a network connection to a backend system, it is useful for development and test scenarios.

see https://github.com/SAP/open-ux-odata/tree/main/packages/ui5-middleware-fe-mockserver

Setup

npm install --save-dev @cpro-js/vite-ui5-mockserver-plugin

vite.config.ts

import { resolve } from "path";
import { defineConfig } from "vite";
import viteUI5MockserverPlugin from "@cpro-js/vite-ui5-mockserver-plugin";

return defineConfig({
  // ...
  plugins: [
    // ...
    viteUI5MockserverPlugin({
      // accepts same options as @sap-ux/fe-mockserver-core
      services: [
        {
          urlPath: "/sap/opu/odata/CPRO/TEST_SRV",
          metadataPath: resolve(__dirname, "src/localService/metadata.xml"),
          mockdataPath: resolve(__dirname, "src/localService/mockdata"),
          watch: true,
        },
      ],
    }),
  ],
});

License

MIT - see License.

Readme

Keywords

none

Package Sidebar

Install

npm i @cpro-js/vite-ui5-mockserver-plugin

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

17 kB

Total Files

8

Last publish

Collaborators

  • texttechne
  • zinserjan