Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

A Qpoint adapter for replacing content in the response html

License

Notifications You must be signed in to change notification settings

qpoint-io/qpoint-replace-content

Repository files navigation

qpoint-replace-content

A Qpoint adapter for replacing content in the response html

Usage

import Endpoint from "@qpoint/endpoint";
import proxy from "@qpoint/proxy";
import replaceContent from "@qpoint/replace-content";
import rewriteHtml from "@qpoint/rewrite-html";

export default new Endpoint()
  // proxy to deno.land
  .use(proxy({ appUrl: "https://deno.land" }))

  // replace text occurrences
  .use(replaceContent({ 
    rules: [
      { from: "Deno", to: "Deyes" },
      { from: "deno", to: "deyes" },
      { from: "JavaScript", to: "FunnyScript" },
      { from: "TypeScript", to: "StrictScript" }
    ] 
  }))

  // activate the rewrite
  .use(rewriteHtml({}))

Installation

npm add @qpoint/replace-content

About

A Qpoint adapter for replacing content in the response html

Resources

License

Stars

Watchers

Forks

Packages

No packages published