mauricedb / server-side-rendering-with-create-react-app

Server-side Rendering with Create-React-App
https://medium.com/@maurice.de.beijer/react-server-side-rendering-with-webpack-c4da49c87c34
MIT License
32 stars 16 forks source link

Debug server side #2

Closed MartinGian closed 6 years ago

MartinGian commented 6 years ago

Hi!

Cool project. I have a question, is there a way to debug the server side express middlewares? Using vscode.

Thank you!

mauricedb commented 6 years ago

@MartinGian That is really easy in VSCode. Make sure the client app is built first using yarn build Then start VS-Code and open ./server/index.js and press F5. It will start it with the debugger attached. Put a breakpoint somewhere in the router.get("/", ...) in ./server/react-app.js. Open a browser at http://localhost:3001 and you should see the code stopping at the breakpoint.