micro-app/packages/icpx-platform/build/mockServer.ts
2023-05-30 19:27:03 +08:00

14 lines
431 B
TypeScript

import { createMockMiddleware } from 'umi-mock-middleware';
import express from 'express';
const createMockServer = () => {
const mockTarget = `http://127.0.0.1:${process.env.MOCK_SERVER_PORT}`;
const app = express();
app.use(createMockMiddleware());
app.listen(process.env.MOCK_SERVER_PORT, () => {
console.log(`Mock Server listening at ${mockTarget}`);
});
return mockTarget;
};
export default createMockServer;