Public | Automated Build

Last pushed: 17 days ago
Short Description
Neo4J backed Content By Concept public read api
Full Description

Public API for Content By Concept (public-content-by-concept-api)

Provides a public API for Content retrieved via Concept that is mentioned stored in a Neo4J graph database

Installation & running locally

  • go get -u github.com/Financial-Times/public-content-by-concept-api
  • cd $GOPATH/src/github.com/Financial-Times/public-content-by-concept-api
  • go test ./...
  • go install
  • $GOPATH/bin/public-content-by-concept-api --neo-url={neo4jUrl} --port={port} --log-level={DEBUG|INFO|WARN|ERROR}--cache-duration{e.g. 22h10m3s}
    Optional arguments are:
    --neo-url defaults to http://localhost:7474/db/data, which is the out of box url for a local neo4j instance.
    --port defaults to 8080.
    --cache-duration defaults to 1 hour.

Examples:

  • curl http://localhost:8080/content?isAnnotatedBy=http://api.ft.com/things/dbb0bdae-1f0c-11e4-b0cb-b2227cce2b54
  • curl http://localhost:8080/content?isAnnotatedBy=http://api.ft.com/things/dbb0bdae-1f0c-11e4-b0cb-b2227cce2b54&fromDate=2016-01-02&toDate=2016-01-05&limit=200

Note: Optional request params: limit (number of items to return), toDate, fromDate

API definition

Based on the following google doc

Healthchecks

Healthchecks: http://localhost:8080/__health

Logging

The application uses logrus, the logfile is initialised in main.go.

Logging requires an env app parameter: for all environments other than local, logs are written to file. When running locally logging
is written to console (if you want to log locally to file you need to pass in an env parameter that is != local).

NOTE: http://localhost:8080/__gtg end point is not logged as it is called every second from varnish and this information is not needed in logs/splunk

Docker Pull Command
Owner
coco

Comments (0)