Skip to content

RequestLogger is a local request logging tool which allows you to log incoming request bodies to a file and provides a user-friendly interface built with React.

Notifications You must be signed in to change notification settings

yashwanth2714/RequestLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RequestLogger

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.

Features

  • 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.

Installation

  • Downloading the Zip File:

    1. Visit the RequestLogger GitHub repository.
    2. Click on the "Code" button.
    3. Select "Download ZIP" from the dropdown menu.
    4. Extract the downloaded ZIP file to your desired location.
  • Cloning the Repository (Command Line):

    1. Alternatively, open your terminal.
    2. Navigate to the directory where you want to clone the repository
    3. 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:
      npm -v
      This command should print the installed version of npm. If npm is not recognized, you need to download the recommended version of Node.js.
    • 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:
      npm -v
      This command should now print the installed version of npm.
  • 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

Usage

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:

  1. Start the server and client:

    npm run start
  2. Open your browser and navigate to http://localhost:3000 to access the React UI.

  3. 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.

  4. 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.

Server and React Configuration

  • Changing Server PORT: If you decide to change the PORT number in the server's config.js file, please follow these additional steps:

    1. Open the server's config.js file in the RequestLogger project directory.

    2. 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...
      };
    3. 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 the REACT_APP_BACKEND_URL in the React .env file to match the new port. Follow these steps:

    1. Open the React .env file in the RequestLogger/client directory.

    2. Locate the REACT_APP_BACKEND_URL and update it with the new port number.

      // .env
      REACT_APP_BACKEND_URL=http://localhost:5001
    3. Save the .env file.

This ensures that the React frontend communicates with the correct backend URL based on the updated server configuration.

Contributing

If you'd like to contribute to RequestLogger, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and submit a pull request.

⭐ the repo, if you like the project

RequestLogger.1.mp4

About

RequestLogger is a local request logging tool which allows you to log incoming request bodies to a file and provides a user-friendly interface built with React.

Topics

Resources

Stars

Watchers

Forks