Skip to content

Commit

Permalink
all rediflare routes under /-_-/
Browse files Browse the repository at this point in the history
  • Loading branch information
lambrospetrou committed Sep 28, 2024
1 parent 8d71c7e commit 8d2bf25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions hurl/happy.hurl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POST http://127.0.0.1:8787/v1/redirects.Upsert
POST http://127.0.0.1:8787/-_-/v1/redirects.Upsert
```json
{
"ruleUrl": "http://127.0.0.1:8787/test-rule",
Expand All @@ -13,7 +13,7 @@ GET http://127.0.0.1:8787/test-rule
HTTP 301
Location: https://skybear.net

POST http://127.0.0.1:8787/v1/redirects.Upsert
POST http://127.0.0.1:8787/-_-/v1/redirects.Upsert
```json
{
"ruleUrl": "http://127.0.0.1:8787/test-rule",
Expand All @@ -28,7 +28,7 @@ GET http://127.0.0.1:8787/test-rule
HTTP 307
Location: https://about.skybear.net

POST http://127.0.0.1:8787/v1/redirects.Upsert
POST http://127.0.0.1:8787/-_-/v1/redirects.Upsert
```json
{
"ruleUrl": "http://127.0.0.1:8787/test-rule-full",
Expand All @@ -44,13 +44,13 @@ HTTP 301
Location: https://lambros.dev/path
boomer: value1

GET http://127.0.0.1:8787/v1/redirects.List
GET http://127.0.0.1:8787/-_-/v1/redirects.List
HTTP 200
[Asserts]
jsonpath "$.data.rules" count == 2
jsonpath "$.data.stats" count == 0

POST http://127.0.0.1:8787/v1/redirects.Delete
POST http://127.0.0.1:8787/-_-/v1/redirects.Delete
```json
{
"ruleUrl": "http://127.0.0.1:8787/test-rule-full"
Expand All @@ -60,7 +60,7 @@ HTTP 200
[Asserts]
jsonpath "$.data.rules" count == 1

POST http://127.0.0.1:8787/v1/redirects.Delete
POST http://127.0.0.1:8787/-_-/v1/redirects.Delete
```json
{
"ruleUrl": "http://127.0.0.1:8787/test-rule"
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ export class RediflareRedirectRule extends DurableObject {

const CONTROL_ROUTE_HANDLERS = new Map([
// ["GET /-_-/debug", routeDebug],
["GET /v1/redirects.List", routeListUrlRedirects],
["POST /v1/redirects.Upsert", routeUpsertUrlRedirect],
["POST /v1/redirects.Delete", routeDeleteUrlRedirect],
["GET /-_-/v1/redirects.List", routeListUrlRedirects],
["POST /-_-/v1/redirects.Upsert", routeUpsertUrlRedirect],
["POST /-_-/v1/redirects.Delete", routeDeleteUrlRedirect],
]);

export default {
Expand Down

0 comments on commit 8d2bf25

Please sign in to comment.