Creates and returns a StreetJS application instance.
Option
Type
Default
Description
port
number
3000
Listen port
host
string
'0.0.0.0'
Bind address
requestTimeoutMs
number
30000
Per-request timeout
maxBodyBytes
number
1048576
Request body size limit
uploadsDir
string
'./uploads'
Multipart upload directory
StreetApp
Method
Signature
Description
listen
(port?, host?) => Promise<void>
Start the HTTP server
close
() => Promise<void>
Gracefully stop the server
use
(mw: MiddlewareFn) => void
Register global middleware
registerController
(ctor: Constructor) => void
Mount a controller
openApiSpec
() => object
Generate OpenAPI 3.0 spec
Decorators
Decorator
Target
Description
@Controller(prefix)
Class
Declare an HTTP controller
@Get(path)
Method
Handle GET requests
@Post(path)
Method
Handle POST requests
@Put(path)
Method
Handle PUT requests
@Patch(path)
Method
Handle PATCH requests
@Delete(path)
Method
Handle DELETE requests
@Injectable()
Class
Register with DI container
@Validate(schema)
Method
Validate request shape
@ApiOperation(opts)
Method
OpenAPI metadata
Exceptions
All exceptions extend StreetException and are automatically serialized as JSON.
Class
Status
BadRequestException
400
UnauthorizedException
401
ForbiddenException
403
NotFoundException
404
ConflictException
409
UnprocessableException
422
InternalException
500
ServiceUnavailableException
503
DatabaseConnectionError
503
FeatureUnavailableInEdgeRuntimeError
501
Database
PgPool
Pool of PostgreSQL connections using the StreetJS wire driver.
1
2
3
4
5
6
pool.query(sql,params?)// Execute a parameterized querypool.transaction(fn)// Run fn in a BEGIN/COMMIT/ROLLBACK blockpool.stream(sql)// Return a readable stream of result rowspool.acquire()// Acquire a raw PgConnectionpool.release(conn)// Return a connection to the poolpool.close()// Close all connections
@RetainFor('90d')// Mark field for retention enforcement@Encrypt()// Mark field for AES-256-GCM encryption@Classify('internal')// Mark field with classification level@Sensitive()// Mark field for audit log redaction
FieldEncryptor performs the transparent AES-256-GCM encrypt/decrypt of @Encrypt() fields and is wired into the repository layer (encryptEntity/decryptEntity); redactByClassification redacts @Classify() fields above a threshold for logging.
VaultSecretProvider, AwsSecretsManagerProvider, AzureKeyVaultProvider, GcpSecretManagerProvider implement SecretProvider.get(key). SecretRotationManager watches a key and emits rotate events (with an onRotate hook to recycle pool connections).
Structured JSON logger with child(bindings), Error serialization, dev pretty-printing, and Cloud Run severity format (auto-detected via K_SERVICE). Use correlationMiddleware(logger) for per-request correlation IDs.