This is a web application to view a specific file under the server log directory and display at maximum 10 lines at a time.
- Node.js (version 14 or higher)
- npm (Node Package Manager)
- Clone the repository:
git clone <repository-url>
cd log-viewer-app
- Install the dependencies for the server:
cd server
npm install
- Install the dependencies for the client:
cd ../client
npm install
- Start the server:
cd server
npm start
The server will be running at http://localhost:3000.
- Open a new terminal and start the client:
cd client
npm start
The client will be accessible at http://localhost:8080.
-
Open your web browser and visit http://localhost:8080.
-
Login using the username and password: admin:admin.
-
Input the path to the log file (e.g., /var/log/example.log) in the input box and click the "Load" button.
-
The content of the log file will be displayed in the textarea with line numbers.
-
Use the navigation buttons to browse through the log file.
To run the server-side unit tests, use the following command in the server directory:
npm test
- The server uses the readline module to efficiently read large log files, ensuring that it doesn't exceed memory limits.
- This project is intended for learning purposes and may not be suitable for production use.