Create web-dev-server.md
what I ran into with web-dev-server
This commit is contained in:
parent
20a0fd33b8
commit
653800b8ac
1 changed files with 31 additions and 0 deletions
31
cmd/web-dev-server.md
Normal file
31
cmd/web-dev-server.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
start server with reload
|
||||
|
||||
`wds -c web-demo-server.config.mjs --watch`
|
||||
|
||||
Who would have though that the mocks that were setup used cookies to communicate with the client
|
||||
So I had to resort to deleting them because otherwise the cookies of the previous run were still in.
|
||||
After the reset new values are probably used. TODO verify that.
|
||||
|
||||
I took out the customer specifics here (middleware)
|
||||
|
||||
```javascript
|
||||
import ...
|
||||
|
||||
/// removing the cookies makes sure the mocks work allright
|
||||
const removeCookies = () => {
|
||||
return async (context, next) => {
|
||||
// console.log(context); // can be turned on for debugging
|
||||
context.request.header.cookie="";
|
||||
return next();
|
||||
};
|
||||
};
|
||||
|
||||
export default {
|
||||
open: 'demo',
|
||||
nodeResolve: true,
|
||||
middleware: [
|
||||
removeCookies(),
|
||||
]
|
||||
};
|
||||
|
||||
```
|
||||
Loading…
Add table
Reference in a new issue