wireguard-dashboard-admin/src/mockProdServer.ts

15 lines
364 B
TypeScript
Raw Normal View History

2021-10-16 16:16:58 +08:00
import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer";
2022-08-22 21:34:55 +08:00
const modules: Record<string, any> = import.meta.glob("../mock/*.ts", {
eager: true
});
2022-04-18 11:15:46 +08:00
const mockModules = [];
Object.keys(modules).forEach(key => {
mockModules.push(...modules[key].default);
});
2021-10-16 16:16:58 +08:00
export function setupProdMockServer() {
createProdMockServer(mockModules);
}