Skip to content

How do I use namespaces like with express? #16

Closed Answered by pengzhanbo
DoctaCloak asked this question in Q&A
Discussion options

You must be logged in to vote

The plugin already supports this feature.

You can:

import { defineMock } from 'vite-plugin-mock-dev-server'

export default defineMock({
  url: '/authentications/:uuid/init',
  body({ params }) {
      console.log(params.uuid)
  }
})

The uuid in the route will be resolved into the request.params object.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DoctaCloak
Comment options

@pengzhanbo
Comment options

Answer selected by pengzhanbo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants