t3-code-android-nightly/.repos/alchemy-effect/examples/neon/alchemy.native.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

35 lines
1 KiB
TypeScript

import * as Alchemy from "alchemy";
import * as Neon from "alchemy/Neon";
import * as Effect from "effect/Effect";
import { resources } from "./src/resources.ts";
import { features } from "./src/features.ts";
import { website } from "./src/website.ts";
export default Alchemy.Stack(
"NeonUploadNativeTutorial",
{
providers: Neon.providers(),
state: Alchemy.localState(),
},
Effect.gen(function* () {
const { branch, uploads, auth, appOrigin } = yield* resources;
const api = yield* Neon.Function("Api", {
branch,
main: "./src/native.ts",
env: {
APP_ORIGIN: appOrigin,
UPLOAD_BUCKET: uploads.bucketName,
AUTH_URL: auth.baseUrl,
AUTH_JWKS_URL: auth.jwksUrl,
},
});
yield* Neon.FunctionTrigger("ProcessUploads", {
function: api,
name: "ProcessUploads",
type: "storage_object_created",
storageObjectCreated: { bucket: uploads, prefix: "incoming/" },
path: "/jobs/upload",
});
return { ...(yield* website(api)), ...(yield* features) };
}),
);