gzheyts / traffic-reporter-redis

Spring Boot with Redis demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Traffic report service with Redis database

Installation

  • Start Redis server
redis-server --loglevel verbose
  • Start application
./mvnw test spring-boot:run

Usage

  • Save traffic links
curl -X POST "http://localhost:8080/visited_links"\
    -H "accept: */*" -H "Content-Type: application/json"\
    -d "{ \"links\": [ \"https://ya.ru\", \"https://ya.ru?q=123\", \"google.com\", \"https://stackoverflow.com/questions/11828270/how-to-exit-the-vim-editor\"]}"
    

response

{"status":"ok"}
  • Query unique domains
 curl -X GET "http://localhost:8080/visited_domains?from=$(( `date +%s` - 60))&to=$(( `date +%s`))" -H "accept: */*"

response

{"domains":["ya.ru","google.com","stackoverflow.com"],"status":"ok"}

About

Spring Boot with Redis demo


Languages

Language:Java 100.0%