Skip to content

Commit

Permalink
move to cloudflare workers (#1229)
Browse files Browse the repository at this point in the history
* move to cloudflare workers

* remove junk
  • Loading branch information
Geometrically authored Jul 4, 2023
1 parent 05d9948 commit 4c8c35a
Show file tree
Hide file tree
Showing 7 changed files with 1,738 additions and 909 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ node_modules
.cache
.output
.env
.dev.vars
dist
.wrangler/

generated/
!.gitkeep
Expand Down
12 changes: 8 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ export default defineNuxtConfig({
},
},
runtimeConfig: {
apiBaseUrl: process.env.BASE_URL ?? getApiUrl(),
rateLimitKey: process.env.RATE_LIMIT_IGNORE_KEY,
// @ts-ignore
apiBaseUrl: process.env.BASE_URL ?? globalThis.BASE_URL ?? getApiUrl(),
// @ts-ignore
rateLimitKey: process.env.RATE_LIMIT_IGNORE_KEY ?? globalThis.RATE_LIMIT_IGNORE_KEY,
public: {
apiBaseUrl: getApiUrl(),
ariadneBaseUrl: getAriadneUrl(),
Expand Down Expand Up @@ -294,11 +296,13 @@ export default defineNuxtConfig({
})

function getApiUrl() {
return process.env.BROWSER_BASE_URL ?? STAGING_API_URL
// @ts-ignore
return process.env.BROWSER_BASE_URL ?? globalThis.BROWSER_BASE_URL ?? STAGING_API_URL
}

function getAriadneUrl() {
return process.env.BROWSER_ARIADNE_URL ?? STAGING_ARIADNE_URL
// @ts-ignore
return process.env.BROWSER_ARIADNE_URL ?? globalThis.BROWSER_ARIADNE_URL ?? STAGING_ARIADNE_URL
}

function getDomain() {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "nuxi dev",
"generate": "nuxi generate",
"preview": "nuxi preview",
"postinstall": "nuxi prepare",
"postinstall": "nuxi prepare && patch-package",
"lint:js": "eslint . --ext .js,.vue,.ts",
"lint": "npm run lint:js && prettier --check .",
"fix": "eslint . --fix --ext .js,.vue,.ts && prettier --write .",
Expand Down Expand Up @@ -33,7 +33,8 @@
"typescript": "^5.0.4",
"vite-plugin-eslint": "^1.8.1",
"vite-svg-loader": "^4.0.0",
"vue-tsc": "^1.6.5"
"vue-tsc": "^1.6.5",
"patch-package": "^7.0.0"
},
"dependencies": {
"@ltd/j-toml": "^1.38.0",
Expand Down
Loading

0 comments on commit 4c8c35a

Please sign in to comment.