mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
⭐ feat(www): Finish up on the onboarding (#210)
Merging this prematurely to make sure the team is on the same boat... like dang! We need to find a better way to do this. Plus it has become too big
This commit is contained in:
45
infra/api.ts
45
infra/api.ts
@@ -1,8 +1,8 @@
|
||||
import { vpc } from "./vpc";
|
||||
import { bus } from "./bus";
|
||||
import { domain } from "./dns";
|
||||
import { email } from "./email";
|
||||
import { secret } from "./secret";
|
||||
import { database } from "./database";
|
||||
import { postgres } from "./postgres";
|
||||
|
||||
sst.Linkable.wrap(random.RandomString, (resource) => ({
|
||||
properties: {
|
||||
@@ -14,51 +14,17 @@ export const urls = new sst.Linkable("Urls", {
|
||||
properties: {
|
||||
api: "https://api." + domain,
|
||||
auth: "https://auth." + domain,
|
||||
site: $dev ? "http://localhost:4321" : "https://" + domain,
|
||||
site: $dev ? "http://localhost:3000" : "https://" + domain,
|
||||
},
|
||||
});
|
||||
|
||||
export const authFingerprintKey = new random.RandomString(
|
||||
"AuthFingerprintKey",
|
||||
{
|
||||
length: 32,
|
||||
},
|
||||
);
|
||||
|
||||
export const auth = new sst.aws.Auth("Auth", {
|
||||
issuer: {
|
||||
timeout: "3 minutes",
|
||||
handler: "./packages/functions/src/auth.handler",
|
||||
link: [
|
||||
bus,
|
||||
email,
|
||||
database,
|
||||
authFingerprintKey,
|
||||
secret.PolarSecret,
|
||||
secret.GithubClientID,
|
||||
secret.DiscordClientID,
|
||||
secret.GithubClientSecret,
|
||||
secret.DiscordClientSecret,
|
||||
],
|
||||
permissions: [
|
||||
{
|
||||
actions: ["ses:SendEmail"],
|
||||
resources: ["*"],
|
||||
},
|
||||
],
|
||||
},
|
||||
domain: {
|
||||
name: "auth." + domain,
|
||||
dns: sst.cloudflare.dns(),
|
||||
},
|
||||
})
|
||||
|
||||
export const apiFunction = new sst.aws.Function("ApiFn", {
|
||||
vpc,
|
||||
handler: "packages/functions/src/api/index.handler",
|
||||
link: [
|
||||
bus,
|
||||
urls,
|
||||
database,
|
||||
postgres,
|
||||
secret.PolarSecret,
|
||||
],
|
||||
timeout: "3 minutes",
|
||||
@@ -77,6 +43,5 @@ export const api = new sst.aws.Router("Api", {
|
||||
})
|
||||
|
||||
export const outputs = {
|
||||
auth: auth.url,
|
||||
api: api.url,
|
||||
};
|
||||
Reference in New Issue
Block a user