Chrome devtools network tab like functionality for node apps!!!
There is no easy way to view network requests made from a node app similar to network tab in chrome devtools for ui apps.
This project solves this by tracking the network requests made from your node application and showing them in a chrome dev tools like UI !!!
- Install the package
npm i network-activity-viewer
- Start network tracking
// Add this code in a main js / ts file import { initNetworkLogging } from 'network-activity-viewer'; initNetworkLogging();
- See the requests made by navigating to http://localhost:4500 in the browser!
This is a nx monorepo with the following projects
The Angular UI application which shows the network logs. This project uses angular material and bootstrap.
Dev: Run ng serve
to start the dev ui server.
Build: Run the prod build from projects.json of the project.
The node package which tracks http, https requests, and starts the UI and logs server.
This project has the static folder which contains the UI bundle built from Network log viewer
Project.
Currently this package will start two servers when network logging is initialized.
- Logs Server: Serves Logs over http port 6262
- UI server: Serves the UI code over http port 4500
Publish command: npm publish --access public --otp={otp from authenticator}
(run inside the dist folder of network-debugger
library)
- Build network-debugger project
npx nx run network-debugger:build
- Run
npm link
in thenetwork-debugger
dist folder - Run
npm link network-activity-viewer
in the folder to test
This application was built as a quick solution for a project i was working on.
This application is at a early stage where the basic functionality is available but a lot of good to have things can be built around.
I would appreciate any contributions (including suggestions) especially in the following areas:
- Review current approach of network requests tracking and any suggestions.
- Review current approach of integrating with a node application and any suggestions.
- Creating a better UI for the network log viewing.
- Auto port selection for UI and logs servers as per availability.
- Auto open the network log viewing page in browser once server is started
- Use sockets communication between UI and logs server so that UI can be updated as and when a new request is captured.
- Add functionality to filter, block requests.
- Export the requests as har file.
- Better workflow for copying built UI code to npm package