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? |
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 |
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
uuidin the route will be resolved into therequest.paramsobject.