Skip to content

Calgorr/HTTP_monitor

Repository files navigation

HTTP Monitor Server

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.

Getting Started

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.

  1. Clone the repository:
git clone https://github.com/Calgorr/IE_Backend_Fall.git
  1. Install dependencies:
go mod download
  1. 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>
  1. Start the server:
go run main.go

API Endpoints

The HTTP Monitor Server provides the following API endpoints:

POST /signup

This endpoint allows users to sign up for the service. Users must provide a username and password in the request body.

POST /login

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.

POST /newURL

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.

GET /user/URL/getURLs

This endpoint allows authenticated users to retrieve a list of all URLs that they are monitoring.

GET /user/URL/URLstatistics

This endpoint allows authenticated users to retrieve statistics about the status of the URLs that they are monitoring.

GET /user/warning/:id

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.

Contributing

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,

About

HTTP_monitor implemented in go

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages