RequestLogger is a local request logging tool developed using localtunnel. This tool allows you to log incoming request bodies to a file and provides a user-friendly interface built with React.
- Local Logging: Log incoming request bodies to a file for local analysis.
- React UI: User-friendly interface built with React for easy visualization and interaction.
-
Downloading the Zip File:
- Visit the RequestLogger GitHub repository.
- Click on the "Code" button.
- Select "Download ZIP" from the dropdown menu.
- Extract the downloaded ZIP file to your desired location.
-
Cloning the Repository (Command Line):
- Alternatively, open your terminal.
- Navigate to the directory where you want to clone the repository
- Clone the repository:
git clone https://github.com/yashwanth2714/RequestLogger.git cd RequestLogger
-
Check if npm is Working:
- Ensure that Node.js and npm are installed on your system.
- Open your command prompt or terminal and run:
This command should print the installed version of npm. If npm is not recognized, you need to download the recommended version of Node.js.
npm -v
- Run the downloaded .exe file and follow the installation instructions.
- After the installation is complete, close the current command prompt or terminal.
- Open a new command prompt or terminal and run:
This command should now print the installed version of npm.
npm -v
-
Installing Dependencies:
- Once you are in the project directory, open your command prompt or terminal.
- Run the following command to install the necessary dependencies:
npm run install-all
After the initial setup, you only need to install dependencies once. From the next time, you can simply run the following command in the project directory:
-
Start the server and client:
npm run start
-
Open your browser and navigate to http://localhost:3000 to access the React UI.
-
Localtunnel will provide you with a public URL that you can use to expose your local server. Use this URL to make requests to your local server.
-
Incoming requests will be logged to the server(capturedLogs.txt file) and displayed on the React UI.
Note: The RequestLogger tool is set up to function with the default settings in the config.js file.
-
Changing Server PORT: If you decide to change the PORT number in the server's
config.js
file, please follow these additional steps:-
Open the server's
config.js
file in the RequestLogger project directory. -
Locate the
PORT
setting and update it to the desired port number.// config.js module.exports = { PORT: 5001, // Change to your desired port number // otherConfigOptions... };
-
Save the
config.js
file.
-
-
Updating React .env File: If you've changed the PORT number in the server's
config.js
file, you need to update theREACT_APP_BACKEND_URL
in the React.env
file to match the new port. Follow these steps:-
Open the React
.env
file in the RequestLogger/client directory. -
Locate the
REACT_APP_BACKEND_URL
and update it with the new port number.// .env REACT_APP_BACKEND_URL=http://localhost:5001
-
Save the
.env
file.
-
This ensures that the React frontend communicates with the correct backend URL based on the updated server configuration.
If you'd like to contribute to RequestLogger, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and submit a pull request.