DEBUG: create dedicated debug endpoints

This commit is contained in:
Oliver Eyton-Williams
2020-03-24 10:11:41 +01:00
committed by Mrugesh Mohapatra
parent 35751bacf0
commit c9084aea2c

View File

@ -0,0 +1,18 @@
import { wrapHandledError } from '../utils/create-handled-error';
export default function bootStatus(app) {
const api = app.loopback.Router();
// DEBUG ROUTE
api.get('/sentry/error', () => {
throw Error('debugging sentry');
});
api.get('/sentry/wrapped', () => {
throw wrapHandledError(Error('debugging sentry, wrapped'), {
type: 'info',
message: 'debugmessage',
redirectTo: `a/page`
});
});
app.use(api);
}