This project consists of a Node.js backend API for parsing log files and a React frontend for uploading log files and downloading parsed log messages.
This Node.js backend API parses log files and returns filtered log messages based on error and warning levels.
- Install Dependencies
cd backend npm install
- Build App
npm run build
- Start the server
The server will be running at http://localhost:3001.
npm run start
Run the unit tests using Jest:
npm test
- POST /parse-log
- Accepts a log file (multipart/form-data) and returns parsed log messages in JSON format.
- Express: Web framework
- Multer: Middleware for handling file uploads
- Jest: Testing framework
- Supertest: Library for testing HTTP requests
This React frontend allows users to upload log files, parse them using the backend API, and download the filtered log messages in JSON format.
- Install dependencies:
cd frontend/log-parser npm install
- Start the development server
The app will be running at http://localhost:3000.
npm start
- Open the app in your browser.
- Choose a log file using the file input.
- Click the "Upload and Download" button.
- If successful, a JSON file with filtered log messages will be downloaded.
- React: JavaScript library for building user interfaces
- Axios: Promise-based HTTP client for the browser and Node.js
- Node.js: JavaScript runtime