Tactical Media Broadcast Hub — initial release
Self-hosted multi-platform broadcast newsroom for activist collectives: publishing pipeline with group approval and DST-proof scheduling, TweetDeck-style column wall with hostile-content-safe rendering, live control room with Auto Director, bridged chat governance with polls and quorum, distributed sandboxed transcode workers, encrypted content-addressed archive, monthly analytics. MIT licensed. See README.md and docs/.
This commit is contained in:
commit
aa5e262f3a
880 changed files with 111042 additions and 0 deletions
40
apps/api/src/main.ts
Normal file
40
apps/api/src/main.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import "./telemetry/otel";
|
||||
import { NestFactory } from "@nestjs/core";
|
||||
import { Module } from "@nestjs/common";
|
||||
import { AppModule } from "./app.module";
|
||||
import { FeedsModule } from "./feeds/feeds.module";
|
||||
import { ArchiveModule } from "./archive/archive.module";
|
||||
import { logger } from "./telemetry/logger";
|
||||
|
||||
@Module({ imports: [AppModule, ArchiveModule, FeedsModule] })
|
||||
class RootModule {}
|
||||
|
||||
/** Browser origins allowed to call the API (comma-separated). Defaults cover the dev web server on :3001. */
|
||||
function corsOrigins(): string[] {
|
||||
const configured = process.env.CORS_ORIGINS;
|
||||
if (configured !== undefined && configured.trim() !== "") return configured.split(",").map((o) => o.trim());
|
||||
return ["http://localhost:3001", "http://127.0.0.1:3001", "http://localhost:3000", "http://127.0.0.1:3000"];
|
||||
}
|
||||
|
||||
async function bootstrap(): Promise<void> {
|
||||
const app = await NestFactory.create(RootModule, {
|
||||
logger: ["error", "warn"],
|
||||
abortOnError: false,
|
||||
});
|
||||
// Sessions use bearer tokens; OAuth callbacks also bind the initiating browser with an HttpOnly cookie.
|
||||
app.enableCors({
|
||||
origin: corsOrigins(),
|
||||
credentials: true,
|
||||
methods: ["GET", "POST", "PATCH", "DELETE"],
|
||||
allowedHeaders: ["Authorization", "Content-Type"],
|
||||
});
|
||||
const port = Number(process.env.PORT ?? 3000);
|
||||
app.enableShutdownHooks();
|
||||
await app.listen(port);
|
||||
logger.info({ port }, "api listening");
|
||||
}
|
||||
|
||||
void bootstrap().catch((error: unknown) => {
|
||||
console.error("api bootstrap failed", error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue