Skip to content

Commit

Permalink
cors update- feature-gates, jupiter-proxy, version
Browse files Browse the repository at this point in the history
  • Loading branch information
wentokay committed Apr 10, 2023
1 parent 77bffbb commit 6704a9d
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/workers/feature-gates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"deploy": "wrangler publish"
},
"dependencies": {
"hono": "^2.2.1"
"hono": "^3.1.5"
}
}
10 changes: 9 additions & 1 deletion backend/workers/feature-gates/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { Hono } from "hono";
import { cors } from "hono/cors";

import { FEATURE_GATES } from "./FEATURES";
import { getStripeEnabledGate } from "./stripe";

const app = new Hono();
type Env = {
STRIPE_SECRET: string;
};

const app = new Hono<{ Bindings: Env }>();

app.use("*", cors());

app.get("/", (c) => {
return c.json("ok", 200);
Expand Down
2 changes: 1 addition & 1 deletion backend/workers/jupiter-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@jup-ag/api": "^4.0.1-alpha.0",
"@solana/web3.js": "^1.73.0",
"@supabase/supabase-js": "^2.4.1",
"hono": "^2.7.2",
"hono": "^3.1.5",
"jose": "^4.11.2"
}
}
3 changes: 3 additions & 0 deletions backend/workers/jupiter-proxy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { V4SwapPostRequest } from "@jup-ag/api";
import { Connection } from "@solana/web3.js";
import { createClient } from "@supabase/supabase-js";
import { Hono } from "hono";
import { cors } from "hono/cors";
import { importSPKI, jwtVerify } from "jose";

import ACCOUNTS from "./feeAccounts.json";
Expand All @@ -10,6 +11,8 @@ type MintAddress = keyof typeof ACCOUNTS | undefined;

const app = new Hono();

app.use("*", cors());

// start routes ----------------------------------------

app.post("/swap", async (c) => {
Expand Down
8 changes: 8 additions & 0 deletions backend/workers/version/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
root: true,
extends: ["custom"],
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
};
2 changes: 1 addition & 1 deletion backend/workers/version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"deploy": "wrangler publish"
},
"dependencies": {
"hono": "^2.2.1"
"hono": "^3.1.5"
}
}
3 changes: 3 additions & 0 deletions backend/workers/version/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Hono } from "hono";
import { cors } from "hono/cors";

const app = new Hono();

app.use("*", cors());

app.get("/", (c) => {
return c.json(
{
Expand Down
4 changes: 0 additions & 4 deletions backend/workers/version/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
name = "version"
main = "src/index.ts"
compatibility_date = "2022-09-22"
node_compat = true

[env.development.vars]
STRIPE_SECRET = ""
15 changes: 11 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21966,7 +21966,7 @@ __metadata:
dependencies:
"@cloudflare/workers-types": ^3.16.0
"@coral-xyz/common": "*"
hono: ^2.2.1
hono: ^3.1.5
typescript: ^4.9.5
wrangler: ^2.1.6
languageName: unknown
Expand Down Expand Up @@ -23533,13 +23533,20 @@ __metadata:
languageName: node
linkType: hard

"hono@npm:^2.2.1, hono@npm:^2.2.3, hono@npm:^2.5.8, hono@npm:^2.7.2":
"hono@npm:^2.2.1, hono@npm:^2.2.3, hono@npm:^2.5.8":
version: 2.7.8
resolution: "hono@npm:2.7.8"
checksum: 3ac38c8fbdcdd48cd9dbf70a1869fde4251a43c40b1419cda66028b6605f3856d5c92b9891e84cd010e18dbb76cc6e5cab03c4e51f9d0cc2b5bd3f924c4e88d3
languageName: node
linkType: hard

"hono@npm:^3.1.5":
version: 3.1.5
resolution: "hono@npm:3.1.5"
checksum: f37c7953edc31bcdfbec450ef23bf401b16204860f5e7f044ef2123ea344f2a8d27a6eab8aa53122697bd8dccfae168539267df48a13f3a0cb950052c318a1f9
languageName: node
linkType: hard

"hosted-git-info@npm:^2.1.4":
version: 2.8.9
resolution: "hosted-git-info@npm:2.8.9"
Expand Down Expand Up @@ -27124,7 +27131,7 @@ __metadata:
"@solana/web3.js": ^1.73.0
"@supabase/supabase-js": ^2.4.1
eslint-config-custom: "*"
hono: ^2.7.2
hono: ^3.1.5
jose: ^4.11.2
wrangler: ^2.7.1
languageName: unknown
Expand Down Expand Up @@ -37602,7 +37609,7 @@ __metadata:
resolution: "version@workspace:backend/workers/version"
dependencies:
"@cloudflare/workers-types": ^3.16.0
hono: ^2.2.1
hono: ^3.1.5
typescript: ~4.9.3
wrangler: ^2.1.6
languageName: unknown
Expand Down

0 comments on commit 6704a9d

Please sign in to comment.