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

migrates from router to endpoint #2

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ The proxy needs to mask the url to match the outer domain URL: https://qpoint.io
## Usage

```ts
import Router from "@qpoint/router";
import Endpoint from "@qpoint/endpoint";
import proxy from "@qpoint/proxy";
import maskUrls from "@qpoint/mask-urls";
import rewriteHtml from "@qpoint/rewrite-html";

export default new Router()
export default new Endpoint()
// proxy to qpoint.io
.use(proxy({ appUrl: "https://qpoint.io" }))

Expand Down
4 changes: 2 additions & 2 deletions examples/deno/import_map.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"imports": {
"@qpoint/router": "https://esm.sh/@qpoint/router@0.1.6?bundle",
"@qpoint/endpoint": "https://esm.sh/@qpoint/endpoint@0.0.1?bundle",
"@qpoint/proxy": "https://esm.sh/@qpoint/[email protected]?bundle",
"@qpoint/mask-urls": "https://esm.sh/@qpoint/[email protected]?bundle",
"@qpoint/rewrite-html": "https://esm.sh/@qpoint/[email protected]?bundle"
}
}
}
26 changes: 21 additions & 5 deletions examples/simple/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"@qpoint/proxy": "^0.1.0",
"@qpoint/replace-content": "^0.1.0",
"@qpoint/rewrite-html": "^0.1.0",
"@qpoint/router": "^0.1.12"
"@qpoint/endpoint": "^0.0.1"
}
}
4 changes: 2 additions & 2 deletions examples/simple/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Router from "@qpoint/router";
import Endpoint from "@qpoint/endpoint";
import proxy from "@qpoint/proxy";
import maskUrls from "@qpoint/mask-urls";
import rewriteHtml from "@qpoint/rewrite-html";

export default new Router()
export default new Endpoint()
// proxy to qpoint.io
// .use(proxy({ appUrl: "https://qpoint.io" }))

Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"scripts": {
"build": "tsc",
"release": "npm publish --access=public",
"bundle": "esbuild src/index.ts --outdir=dist --bundle --sourcemap=external --platform=browser --format=esm"
"bundle": "npx esbuild src/index.ts --outdir=dist --bundle --sourcemap=external --platform=browser --format=esm"
},
"dependencies": {
"@qpoint/router": "^0.2.0"
"@qpoint/endpoint": "^0.0.1"
},
"devDependencies": {
"@cloudflare/workers-types": "^3.5.1",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Context } from '@qpoint/router'
import { Context } from '@qpoint/endpoint'
import { UrlRewriter } from './url-rewriter'

export interface MaskUrlsConfig {
Expand Down Expand Up @@ -54,4 +54,4 @@ export default function rewriteHtml(config: MaskUrlsConfig = {}) {
// continue along
return next();
}
}
}
4 changes: 2 additions & 2 deletions src/url-rewriter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Context } from '@qpoint/router'
import { Context } from '@qpoint/endpoint'
import { MaskUrlsConfig } from '.'

interface LinkPattern {
Expand Down Expand Up @@ -66,4 +66,4 @@ export class UrlRewriter {
}
}
}
}
}