Skip to content
Source
Sign inSign up
samwillis/hackernews-realtime
Open History to see the last commit

neon.ts

38 lines1.2 KB

1import { defineConfig } from "@neon/config";
2// Keep schedules disabled in the shared policy, including preview checkouts.
3// ingest:deploy enables only the explicit project/branch in .env.local.
4export default defineConfig({
5 preview: {
6 realtime: {
7 allowedOrigins: [
8 "http://localhost:3000",
9 "http://127.0.0.1:3000",
10 ...(process.env.DEMO_ORIGIN ? [process.env.DEMO_ORIGIN] : []),
11 ...(process.env.DEMO_ADDITIONAL_ORIGINS?.split(",").filter(Boolean) ??
12 []),
13 ],
14 },
15 },
16 functions: {
17 hningest: {
18 name: "Hacker News ingestion",
19 source: "./functions/ingest.ts",
20 env: {
21 INGEST_REQUEST_BUDGET_MS:
22 process.env.INGEST_REQUEST_BUDGET_MS ?? "240000",
23 INGEST_TENURE_MS: process.env.INGEST_TENURE_MS ?? "120000",
24 INGEST_OVERLAP_MS: process.env.INGEST_OVERLAP_MS ?? "90000",
25 INGEST_SMOOTHING_MS: process.env.INGEST_SMOOTHING_MS ?? "28000",
26 },
27 },
28 },
29 triggers: {
30 hnminute: {
31 type: "schedule",
32 function: "hningest",
33 cron: "* * * * *",
34 enabled: false,
35 },
36 },
37 branch: () => ({ functions: { hningest: { runtime: "nodejs24" } } }),
38});