mirror of
https://github.com/jlengrand/sample-node-api.git
synced 2026-03-10 00:31:19 +00:00
Changing sentry connection
This commit is contained in:
10
src/index.js
10
src/index.js
@@ -12,16 +12,11 @@ const Sentry = require("@sentry/node");
|
||||
|
||||
Sentry.init({
|
||||
dsn: "http://e1b49746a229427c9cbb8840bfbde82b@bugsink-rk08sow8w0gw0gk0w44kk08s.138.201.122.228.sslip.io/1",
|
||||
|
||||
// Alternatively, use `process.env.npm_package_version` for a dynamic release version
|
||||
// if your build tool supports it.
|
||||
release: "sample-node-api@1.0.0",
|
||||
|
||||
integrations: [],
|
||||
tracesSampleRate: 0,
|
||||
});
|
||||
|
||||
|
||||
const express = require('express');
|
||||
const http = require('http');
|
||||
const https = require('https');
|
||||
@@ -38,6 +33,11 @@ app.use(cors());
|
||||
const routes = require('./routes/index.route');
|
||||
app.use(routes);
|
||||
|
||||
const PORT = process.env.PORT || 3000;
|
||||
app.listen(PORT, '0.0.0.0', () => {
|
||||
console.log(`Server is running on port ${PORT}`);
|
||||
});
|
||||
|
||||
//start http server
|
||||
const httpServer = http.createServer(app);
|
||||
httpServer.listen(port);
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
Copyright IBM Corporation 2020
|
||||
*/
|
||||
|
||||
const Sentry = require("@sentry/node");
|
||||
|
||||
|
||||
const express = require('express');
|
||||
const cars = require('./cars.route');
|
||||
const accounts = require('./accounts.route');
|
||||
@@ -21,7 +24,8 @@ router.use('/', swagger);
|
||||
|
||||
router.get('/', (req, res) => res.send('Sample Node API Version1'));
|
||||
router.get('/error', (req, res) => {
|
||||
throw new Error("Error Thrown on purpose to send it to Bugsink");
|
||||
res.send('Error');
|
||||
Sentry.captureException(new Error("Error Thrown on purpose to send it to Bugsink"));
|
||||
});
|
||||
|
||||
router.get('/health', (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user