Skip to content

tc-teams/fakefinder-crawler

Repository files navigation

API

API responsible for processing for working with fake new

Run

go build .
go run main.go server 

Docker

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

Exemplo

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

export PLN_URL={{something}}

Template Application

Tamplete

References

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published