npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

simple-dt-dev-proxy-plugin

v0.0.1

Published

A plugin for the dt-app tool to forward API call to local services.

Downloads

2

Readme

Overview

A simple extension for Dynatrace development tools, enabling the routing of certain platform calls to locally running services.

How to use it?

  1. Checkout this project.

  2. Build the project using the following command:

    npm run build
  3. Open the Dynatrace App where you wish to use a local platform service and configure the plugin. To activate the plugin, configure it in the 'app.config.ts' file by specifying the path to your 'dt-dev-proxy-plugin/dist' folder. Below is an example:

     const config: CliOptions = {
        environmentUrl: 'https://${yourtenant}.dev.apps.dynatracelabs.com/',
        plugins: ["../../dt-dev-proxy-plugin/dist"], //this need to point to the dist folder generated by the build in step1
        icon: './assets/davis-icon.png',
        app: {}
     }
  4. Now, start your app using 'npm start' or your preferred startup script. During the startup process, you should see the following message:

      '<yourRootFolder>/proxy-config.yaml' does not exist. Will create 'proxy-config.yaml' file.
       No routes configured. Proxy will not be set up.

    This indicates that the plugin has been detected and no configuration file exists. Consequently, the plugin will create one with the following content:

      verbose: false
      routes: []
  5. Once completed, you can configure routes to your local service by modifying the configuration file. An example of such a configuration might appear as follows:

    verbose: true
    routes:
    - upstream: "http://localhost:8080" # The main URL where requests should be routed
      urlPrefix: "/platform/davis/analyzers" # All requests starting with this prefix are routed
      rewriteRule:
        inputPrefix: "/platform/" # The string "/platform/" in an routed request is replaced with...
        newPrefix: "/public/" # The string "/public/"

What does this example configuration do?

  • Firstly, it forwards all HTTP calls with the prefix "/platform/davis/analyzers" to http://localhost:8080. For example, if the Web App makes a call to http://localhost:3000/platform/davis/analyzers/v1/analyzers, this call is not forwarded to https://nrg77339.dev.apps.dynatracelabs.com/platform/davis/analyzers/v1/analyzers, assuming https://nrg77339.dev.apps.dynatracelabs.com is the configured "environmentUrl".
  • However, this configuration redirects the call to http://localhost:8080/public/davis/analyzers/v1/analyzers. This is due to the rewriteRule, which replaces anything starting with "/platform/" with "/public/". Hence, "platform/davis/analyzers/v1/analyzers" is transformed to "public/davis/analyzers/v1/analyzers" and the altered path is then forwarded to http://localhost:8080.
  • Note that the plugin also sets the "Dt-tenant" and "Authorization" HTTP headers. If there is no proper token available or cached for the Authorization header, the plugin will initiate an SSO call to obtain the appropriate token.