diff --git a/server/controllers/auth.js b/server/controllers/auth.js index b61c2c0..5b0cc34 100644 --- a/server/controllers/auth.js +++ b/server/controllers/auth.js @@ -166,13 +166,7 @@ exports.recoverAccount = async function (fastify, request, reply) { message: `Activation link sent to your email${username ? (': ' + user[0].email) : ''}` }); }) - .catch(errors => { - reply.status(400).send({ - success: false, - message: 'Something went wrong', - errors - }); - }); + .catch(errors => { throw new ErrorHandler(400, false, 'Something went wrong') }); } catch (err) { return catchError(reply, err); } diff --git a/server/server.js b/server/server.js index da7da3d..06742ce 100644 --- a/server/server.js +++ b/server/server.js @@ -51,6 +51,8 @@ fastify.register(require('fastify-mailer'), { } }) +fastify.get('/api', (request, reply) => reply.code(200).send('DebateMe server running...')) + fastify.register(require('./routes/auth'), { prefix: '/api/auth' }) fastify.setNotFoundHandler((request, reply) => {