API responsible for processing for working with fake new
go build .
go run main.go server
docker build -t gcloud/fakefinder-crawler:1.0.0 .
docker run --name app -d --network fakefinderstack_elk -p 8080:8080 --env PLN_URL={{ENV}} -t gcloud/fakefinder-crawler:1.0.0
docker logs bot --follow
request:
curl -H "Content-Type: application/json" -d '{"description":"Anvisa recebe informações oficiais para avaliar retomada de testes da vacina de Oxford para Covid-19"}' http://localhost:8080/search/news
response:
{"description":"Anvisa recebe informações oficiais para avaliar retomada de testes da vacina de Oxford para Covid-19",
"text":[{"date":"2020-09-12T20:38:51Z",
"title":"Anvisa recebe informações oficiais para avaliar retomada de testes da vacina de Oxford para Covid-19",
"similarity":"0.08620689655172414",
"link":"https://g1.globo.com/economia/noticia/2020/09/12/candidato-de-trump-e-eleito-para-comandar-bid.ghtml"}]}
export PLN_URL={{something}}
Middleware - Middleware Patterns in Go.
Route - Making a RESTful JSON API in Go.
serve - Go Web Application Structure - Part 2 - Routing/Serving.
Handler - Making and Using HTTP Middleware.
HandlerFunc - A Recap of Request Handling in Go.
ChainMiddleware - Using Middleware In Go The Right Way.
ServeMux - Git repository.
Elastic
Elastic1
Elastic2