From a7ec957a456bef14c6ef6f258ef0612a12f4993b Mon Sep 17 00:00:00 2001 From: Joao Medeiros Date: Tue, 11 Feb 2020 12:26:56 -0300 Subject: [PATCH] fix deploy webhook router --- api/routes/Router.ts | 7 ------- api/routes/RouterAuth.ts | 15 +++++++++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/routes/Router.ts b/api/routes/Router.ts index e602abd..fa125c8 100644 --- a/api/routes/Router.ts +++ b/api/routes/Router.ts @@ -1,7 +1,6 @@ import { Router } from 'express' import cDeploy from '../controllers/Deploy' import cContainer from '../controllers/Container' -import cDocker from '../controllers/Docker' import CheckJwt from '../middlewares/CheckJwt' const routes = Router() @@ -49,10 +48,4 @@ routes.put( cContainer.update ) -// WebHook -routes.post( - '/api/deploy/webhook/:secret', - cDocker.deploy -) - export default routes diff --git a/api/routes/RouterAuth.ts b/api/routes/RouterAuth.ts index f0f3f13..053d3f9 100644 --- a/api/routes/RouterAuth.ts +++ b/api/routes/RouterAuth.ts @@ -1,11 +1,18 @@ -import c from '../controllers/Auth' +import cAuth from '../controllers/Auth' import validate from '../utils/Validation' import { Router } from 'express' +import cDocker from '../controllers/Docker' const routes = Router() -routes.post('/api/auth/login', validate.login, c.auth) -routes.post('/api/auth/register', validate.register, c.register) -routes.put('/api/auth/changepassword', c.changePassword) +// WebHook +routes.post( + '/api/deploy/webhook/:secret', + cDocker.deploy +) + +routes.post('/api/auth/login', validate.login, cAuth.auth) +routes.post('/api/auth/register', validate.register, cAuth.register) +routes.put('/api/auth/changepassword', cAuth.changePassword) export default routes