How do I use namespaces like with express? #16
-
I’d like to suggest this to my team but one question…say I have a route /authentications/:uuid/init or /authentications/:uuid how would I support that with your plugin like I could in express or webpackdev server? |
Beta Was this translation helpful? Give feedback.
Answered by
pengzhanbo
Feb 24, 2023
Replies: 1 comment 2 replies
-
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 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
pengzhanbo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The plugin already supports this feature.
You can:
The
uuid
in the route will be resolved into therequest.params
object.