Add api versioning

This commit is contained in:
Peter Sykora 2018-04-23 19:34:16 +02:00
parent 0a124ba961
commit 3a06e5d54f

View File

@ -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
module.exports = router