Skip to content

Commit

Permalink
✨ feat: Add api (nestrilabs#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjohiryan authored Sep 10, 2024
1 parent df9f1cf commit 1b1bedf
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 8 deletions.
Binary file removed apps/nexus/bun.lockb
Binary file not shown.
Binary file modified bun.lockb
Binary file not shown.
22 changes: 22 additions & 0 deletions infra/api.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 8 deletions infra/www.ts
Original file line number Diff line number Diff line change
@@ -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)

import { isPermanentStage } from "./stage";

export const www = new cloudflare.PagesProject("www", {
name: "nestri",
accountId: "8405b2acb6746935b975bc2cfcb5c288",
Expand Down Expand Up @@ -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: 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

export const wwwDev = new sst.x.DevCommand("www", {
dev: {
command: "bun run dev",
directory: "apps/www",
autostart: true,
},
})
if (!isPermanentStage) {
new sst.x.DevCommand("www", {
dev: {
command: "bun run dev",
directory: "apps/www",
autostart: true,
},
})
}

// //This creates a resource that can be accessed by itself
// new sst.Linkable.wrap(cloudflare.PageRule, (resource) => ({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions sst-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
"Relay": {
"type": "sst.aws.Service"
"url": string
}
}
}
export {}

0 comments on commit 1b1bedf

Please sign in to comment.