NewsBlur/node/newsblur.coffee

42 lines
1 KiB
CoffeeScript
Raw Normal View History

2021-03-17 09:31:19 -04:00
Sentry = require "@sentry/node"
Tracing = require "@sentry/tracing"
app = require('express')()
2021-03-16 20:07:46 -04:00
server = require('http').createServer(app)
log = require './log.js'
2021-03-17 09:31:19 -04:00
envresult = require('dotenv').config()
if envresult.error
throw envresult.error
original_page = require('./original_page.js').original_page
original_text = require('./original_text.js').original_text
favicons = require('./favicons.js').favicons
unread_counts = require('./unread_counts.js').unread_counts
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Tracing.Integrations.Express({
app
})
],
tracesSampleRate: 1.0
})
app.use(Sentry.Handlers.requestHandler())
app.use(Sentry.Handlers.tracingHandler())
original_page(app)
original_text(app)
favicons(app)
unread_counts(server)
app.get "/debug", (req, res) ->
throw new Error("Debugging Sentry")
app.use(Sentry.Handlers.errorHandler())
log.debug "Starting NewsBlur Node Server: #{process.env.SERVER_NAME}"
2021-03-16 20:07:46 -04:00
server.listen(8008)