From 3a06e5d54f6f30f349840a5ad30f3867c6f1a265 Mon Sep 17 00:00:00 2001 From: Peter Sykora Date: Mon, 23 Apr 2018 19:34:16 +0200 Subject: [PATCH] Add api versioning --- src/routes/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/index.js b/src/routes/index.js index b5c75ea..ee3fddb 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -77,7 +77,7 @@ function checkModuleVersions(moduleVersions) { throw new Error('Invalid parameters provided') } -router.post('/activate0', async ctx => { +router.post('/api/v1/activate0', async ctx => { console.log(ctx.request) console.log(ctx.request.body) ctx.body = await licenseUtil.preactivate( @@ -86,7 +86,7 @@ router.post('/activate0', async ctx => { ) }) -router.post('/activate', async ctx => { +router.post('/api/v1/activate', async ctx => { ctx.body = await licenseUtil.activate( checkAppId(ctx.request.body.appId), checkLicenseNumber(ctx.request.body.licenseNumber), @@ -94,7 +94,7 @@ router.post('/activate', async ctx => { ) }) -router.post('/check', async ctx => { +router.post('/api/v1/check', async ctx => { ctx.body = await licenseUtil.check( checkSystemParams(ctx.request.body.systemParams), checkActivationId(ctx.request.body.activationId), @@ -102,4 +102,4 @@ router.post('/check', async ctx => { ) }) -module.exports = router \ No newline at end of file +module.exports = router