This project is a HTTP Monitor Server that allows users to sign up, log in, and monitor the status of URLs. Users can send URLs to the server, which will retrieve the status of the URL's server and save it to a database. This project is built with the Go programming language, using the Echo framework for the HTTP server and Postgres as the database.
To get started with the HTTP Monitor Server, you will need to install Go and Postgres on your local machine. You will also need to set up a Postgres database for the server to use.
- Clone the repository:
git clone https://github.com/Calgorr/IE_Backend_Fall.git
- Install dependencies:
go mod download
- Set up environment variables:
export DB_USER=<your Postgres username> export DB_PASSWORD=<your Postgres password> export DB_NAME=<your Postgres database name> export JWT_SECRET=<your JWT secret>
- Start the server:
go run main.go
The HTTP Monitor Server provides the following API endpoints:
This endpoint allows users to sign up for the service. Users must provide a username and password in the request body.
This endpoint allows users to log in to the service. Users must provide a username and password in the request body. The server will return a JWT token that can be used to authenticate subsequent requests.
This endpoint allows authenticated users to add a new URL to monitor. Users must provide a URL in the request body. The server will retrieve the status of the URL's server and save it to the database.
This endpoint allows authenticated users to retrieve a list of all URLs that they are monitoring.
This endpoint allows authenticated users to retrieve statistics about the status of the URLs that they are monitoring.
This endpoint allows authenticated users to retrieve a warning message for a specific URL. The server will check the status of the URL's server and return a warning message if the status is not 200 OK.
If you'd like to contribute to the HTTP Monitor Server, please fork the repository and submit a pull request. We welcome contributions of all kinds, including bug fixes,