https://github.com/himanshuraj98/logreader-inito-project
A Dockerized Node.js Application for Logging and Viewing Logs.
https://github.com/himanshuraj98/logreader-inito-project
css docker express-js files git nodejs webinterface
Last synced: 10 days ago
JSON representation
A Dockerized Node.js Application for Logging and Viewing Logs.
- Host: GitHub
- URL: https://github.com/himanshuraj98/logreader-inito-project
- Owner: HimanshuRaj98
- Created: 2023-01-11T18:08:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T20:59:52.000Z (over 2 years ago)
- Last Synced: 2025-01-22T20:08:34.525Z (12 months ago)
- Topics: css, docker, express-js, files, git, nodejs, webinterface
- Language: HTML
- Homepage:
- Size: 686 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js LogReader Inito-Project Application Dockerized
This repository contains a Node.js application that logs information and allows you to view and add logs through a web interface. You can easily set up and run this application using Docker.
## Prerequisites
- Docker installed on your system. You can download it [here](https://www.docker.com/get-started).
## Setup and Usage
1. Clone this repository to your local machine:
```bash
git clone https://github.com/HimanshuRaj98/logreader-inito-project.git
cd logreader-inito-project
2. Build the Docker image for the application:
```bash
docker build --tag node-docker .
3. Run the Docker container, mapping port 3000 on your local machine to port 3000 inside the container:
```bash
docker run -p 3000:3000 node-docker
4. Once the container is running, you can access the application in your web browser at http://localhost:3000.
## Application Routes
This repository contains a Node.js application with the following routes:
- `/`: View existing logs.
- `/addLogs`: Add new logs.
- `/styleAddLogs.css`: CSS file for the "Add Logs" page.
- `/styleViewLogs.css`: CSS file for the "View Logs" page.
- `/getLogs`: Retrieve and display the logged information.
- `/writeLogs`: Write new logs to the file.
## Adding Logs
To add logs, you can use the `/addLogs` route of the application. Provide the log details in the query parameters:
## Parameters
When adding logs using the `/addLogs` route, you need to provide the following parameters:
- `status`: Log status (e.g., INFO, ERROR).
- `operation`: Operation or event description.
- `message`: Log message content.
Logs will be appended to the file.txt file within the container.
These parameters allow you to specify the details for the logs that you want to add. For example:
**Example:**
```plaintext
http://localhost:3000/addLogs?status=INFO&operation=Login&message=User%20logged%20in
```