prose.mock.ts 336 B

12345678910111213
  1. import { defineMock } from 'vite-plugin-mock-dev-server'
  2. import { builder } from '../util'
  3. import proses from '../data'
  4. export default defineMock({
  5. url: '/api/prose',
  6. delay: 100,
  7. body: () => {
  8. const rand = Math.floor(Math.random() * proses.value.length)
  9. const prose = proses.value[rand]
  10. return builder(prose)
  11. },
  12. })