Commit cfb07cbd authored by Tobinsk's avatar Tobinsk
Browse files

Merge branch '11-rename-api-v-1-1-to-v2' into 'master'

Resolve "Rename api v.1.1 to v2"

Closes #11

See merge request !27
parents b92ae832 7f6e4d64
Pipeline #4138 passed with stages
in 2 minutes and 22 seconds
......@@ -23,6 +23,11 @@ kafkaLog.addStream({
level: 'debug',
});
/**
* Version of the api
*/
const version = 2;
/**
* Init the core
* @type {Core}
......@@ -44,7 +49,7 @@ app.use(KafkaCache.middleware);
* K8 needs to get this status. Otherwise loadbalancing is not possible
*/
app.get('/', HealthcheckController.healthy);
app.get('/v1-1/', HealthcheckController.healthy);
app.get(`/v${version}/`, HealthcheckController.healthy);
/**
* first connect to kafka
......@@ -109,22 +114,22 @@ kafka.init().then(async () => {
/**
* API to match a given node with all nodes with uri in Elastic search
*/
app.get('/v1-1/similarto/:node(*)', [...Validator.apiMatch(), ApiController.checkEncoding, kafkaMiddleware, ApiController.match, ApiController.queryKafka]);
app.get(`/v${version}/similarto/:node(*)`, [...Validator.apiMatch(), ApiController.checkEncoding, kafkaMiddleware, ApiController.match, ApiController.queryKafka]);
/**
* API to fetch all edges and nodes interconnected with a given node from neo4j
*/
app.get('/v1-1/sameas/:node(*)', [...Validator.apiConcordance(), ApiController.checkEncoding, kafkaMiddleware, ApiController.concordance, ApiController.queryKafka]);
app.get(`/v${version}/sameas/:node(*)`, [...Validator.apiConcordance(), ApiController.checkEncoding, kafkaMiddleware, ApiController.concordance, ApiController.queryKafka]);
/**
* API to get metadata about a given node
*/
app.get('/v1-1/metadata/:node(*)', [...Validator.apiMetadata(), ApiController.checkEncoding, kafkaMiddleware, ApiController.metadata, ApiController.queryKafka]);
app.get(`/v${version}/metadata/:node(*)`, [...Validator.apiMetadata(), ApiController.checkEncoding, kafkaMiddleware, ApiController.metadata, ApiController.queryKafka]);
/**
* API to get all information about a given node
*/
app.get('/v1-1/all/:node(*)', [...Validator.apiAll(), ApiController.checkEncoding, kafkaMiddleware, ApiController.all, ApiController.queryKafka]);
app.get(`/v${version}/all/:node(*)`, [...Validator.apiAll(), ApiController.checkEncoding, kafkaMiddleware, ApiController.all, ApiController.queryKafka]);
/**
* General error handling
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment