Socket
Book a DemoInstallSign in
Socket

deeptrace-express

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deeptrace-express

DeepTrace's expressjs middleware.

1.2.4
latest
Source
npmnpm
Version published
Weekly downloads
7
-53.33%
Maintainers
2
Weekly downloads
 
Created
Source

express-deeptrace

DeepTrace's expressjs middleware.

Installing

$ yarn add express-deeptrace
# or
$ npm install express-deeptrace

Sample App

const express = require('express')
const axios = require('axios')
const app = express()

app.use(require('deep-trace').middleware({
  dsn: 'https://<APP>:<SECRET>@api.deeptrace.io/',
}))

app.get('/', async (req, res) => {
  const response = await req.deeptrace.context(async (headers) => {
    return axios.get('https://localhost:3000/users', { headers })
  })

  res.status(200)
      .json(response.data)
})

app.get('/users', async (req, res) => {
  const reporter = deeptrace.bind(req, res)

  reporter.expose((headers) => {
    res.set(headers)
  })

  res.status(200)
     .json([ 'foo', 'bar', 'baz' ])
})

app.listen(3000)

Keywords

expressjs

FAQs

Package last updated on 20 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.