mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
✨ feat: Add api (#112)
Add the api route -> https://nexus.nestri.workers.dev/
This commit is contained in:
Binary file not shown.
22
infra/api.ts
Normal file
22
infra/api.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { isPermanentStage } from "./stage";
|
||||||
|
|
||||||
|
//TODO: Use this instead of wrangler
|
||||||
|
// export const api = new sst.cloudflare.Worker("apiApi", {
|
||||||
|
// url: true,
|
||||||
|
// handler: "packages/api/src/index.ts",
|
||||||
|
// // live: true,
|
||||||
|
// });
|
||||||
|
|
||||||
|
if (!isPermanentStage) {
|
||||||
|
new sst.x.DevCommand("apiDev", {
|
||||||
|
dev: {
|
||||||
|
command: "bun run dev",
|
||||||
|
directory: "packages/api",
|
||||||
|
autostart: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// export const outputs = {
|
||||||
|
// api: api.url
|
||||||
|
// }
|
||||||
19
infra/www.ts
19
infra/www.ts
@@ -1,5 +1,7 @@
|
|||||||
//Deploys the website to cloudflare pages under the domain nestri.io (redirects all requests to www.nestri.io to avoid duplicate content)
|
//Deploys the website to cloudflare pages under the domain nestri.io (redirects all requests to www.nestri.io to avoid duplicate content)
|
||||||
|
|
||||||
|
import { isPermanentStage } from "./stage";
|
||||||
|
|
||||||
export const www = new cloudflare.PagesProject("www", {
|
export const www = new cloudflare.PagesProject("www", {
|
||||||
name: "nestri",
|
name: "nestri",
|
||||||
accountId: "8405b2acb6746935b975bc2cfcb5c288",
|
accountId: "8405b2acb6746935b975bc2cfcb5c288",
|
||||||
@@ -33,14 +35,15 @@ export const www = new cloudflare.PagesProject("www", {
|
|||||||
//TODO: Maybe handle building Qwik ourselves? This prevents us from relying on CF too much, we are open-source anyway 🤷🏾♂️
|
//TODO: Maybe handle building Qwik ourselves? This prevents us from relying on CF too much, we are open-source anyway 🤷🏾♂️
|
||||||
//TODO: Add a local dev server for Qwik that can be linked with whatever we want
|
//TODO: Add a local dev server for Qwik that can be linked with whatever we want
|
||||||
//TODO: Link the www PageRule with whatever we give to the local dev server
|
//TODO: Link the www PageRule with whatever we give to the local dev server
|
||||||
|
if (!isPermanentStage) {
|
||||||
export const wwwDev = new sst.x.DevCommand("www", {
|
new sst.x.DevCommand("www", {
|
||||||
dev: {
|
dev: {
|
||||||
command: "bun run dev",
|
command: "bun run dev",
|
||||||
directory: "apps/www",
|
directory: "apps/www",
|
||||||
autostart: true,
|
autostart: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// //This creates a resource that can be accessed by itself
|
// //This creates a resource that can be accessed by itself
|
||||||
// new sst.Linkable.wrap(cloudflare.PageRule, (resource) => ({
|
// new sst.Linkable.wrap(cloudflare.PageRule, (resource) => ({
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 590 B After Width: | Height: | Size: 590 B |
4
sst-env.d.ts
vendored
4
sst-env.d.ts
vendored
@@ -7,6 +7,10 @@ declare module "sst" {
|
|||||||
"type": "sst.sst.Secret"
|
"type": "sst.sst.Secret"
|
||||||
"value": string
|
"value": string
|
||||||
}
|
}
|
||||||
|
"Relay": {
|
||||||
|
"type": "sst.aws.Service"
|
||||||
|
"url": string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export {}
|
export {}
|
||||||
|
|||||||
Reference in New Issue
Block a user