# runtime/entrypoints/server.entrypoint.ts

> 24 lines of code and 4 definitions.

Tree: Project Scripts
Language: typescript
Layer: runtime
Canonical: https://banes-lab.com/anatomy/scripts#file-scripts-runtime-entrypoints-server-entrypoint-ts
Source text: https://banes-lab.com/source/scripts/runtime/entrypoints/server.entrypoint.ts.txt

Listed in [runtime/entrypoints](https://banes-lab.com/api/source/scripts/runtime/entrypoints.md), after [runtime/entrypoints/route.entrypoint.ts](https://banes-lab.com/source/scripts/runtime/entrypoints/route.entrypoint.ts.md) and before [runtime/entrypoints/snapshot.entrypoint.ts](https://banes-lab.com/source/scripts/runtime/entrypoints/snapshot.entrypoint.ts.md).

## Definitions

- `files` (lexical_declaration, line 12)
- `findings` (lexical_declaration, line 18)
- `shown` (lexical_declaration, line 20)
- `verdict` (lexical_declaration, line 24)

## Contained in

- [runtime/entrypoints](https://banes-lab.com/anatomy/scripts/folder-scripts-runtime-entrypoints.md)

## Enforces

- [Encryption in Transit](https://banes-lab.com/records/architecture/encryption-in-transit.md)

## Source

```typescript
import { transportFindings, transportVerdict } from "#core/validators/server.validator";
import { NO_BUILD_CONFIG } from "#configuration/strings/server.strings";
import { buildConfigFiles } from "#core/loaders/server.loader";
import { defineCheck } from "@govlab/context/check";
import { listenerSurfacesOf } from "#core/adapters/server.adapter";
import { normalizePath } from "@ssot/govlab/shared/resolvers/anchor.resolver.ts";
import process from "node:process";
import { relative } from "node:path";

defineCheck({ detects: [], enforces: ["architecture:encryption-in-transit"] });

const files = buildConfigFiles();

if (files.length === 0) {
    process.stderr.write(NO_BUILD_CONFIG);
    process.exitCode = 1;
} else {
    const findings = await Promise.all(
        files.map(async (file) => {
            const shown = normalizePath(relative(process.cwd(), file));
            return transportFindings(shown, await listenerSurfacesOf(file));
        }),
    );
    const verdict = transportVerdict(findings.flat(), files.length);
    process.stdout.write(verdict.text);
    process.exitCode = verdict.held ? 0 : 1;
}
```
