An HTTP endpoint monitor service written in go with RESTful API.
- You can run the project using docker-compose by running
docker-compose up
( change container port indocker-compose.yml
)
id(pk) | created_at | username | password |
---|---|---|---|
integer | datetime | varchar(255) | varchar(255) |
id(pk) | created_at | user_id(fk) | url | method | threshold |
---|---|---|---|---|---|
integer | datetime | varchar(255) | varchar(255) | varchar(255) | integer |
id(pk) | created_at | url_id(fk) | status_code |
---|---|---|---|
integer | datetime | integer | integer |
id(pk) | created_at | url_id(fk |
---|---|---|
integer | datetime | integer |
For all requests and responses we have Content-Type: application/json
.
Authorization is with JWT.
POST /api/users/login
request structure:
{
"username":"foo", // alpha numeric, length >= 4
"password":"*bar*" // text, length >=4
}
POST /api/users
request structure (same as login):
{
"username":"foo", // alpha numeric, length >= 4
"password":"*bar*" // text, length >=4
}
POST /api/urls
request structure:
{
"url":"http://some-valid-url.com" // valid url address
"method":"GET" // valid url method
"threshold":20 // url fail threshold
}
GET /api/urls
####Get URL stats:
GET /api/urls/:urlID
urlID
a valid url id
GET /api/alerts