Skip to content

Commit

Permalink
server: add test api
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham-Lal committed Jul 18, 2024
1 parent c56574e commit 9683047
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 1 addition & 7 deletions server/controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 9683047

Please sign in to comment.