feat: добавить базовые сервисы image-platform
- добавлены backend, admin, gateway и worker skeleton - добавлены Drizzle schema, database package и initial migration - добавлены shared packages для RabbitMQ topology и S3 helpers - обновлены dev-инфраструктура, env example, scripts и dependencies - обновлена документация под versioned image URLs и read-through flow
This commit is contained in:
37
apps/backend/src/main.ts
Normal file
37
apps/backend/src/main.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { NestFactory } from "@nestjs/core"
|
||||
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger"
|
||||
|
||||
import { AppModule } from "./app.module"
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule)
|
||||
|
||||
app.setGlobalPrefix("api")
|
||||
app.enableShutdownHooks()
|
||||
|
||||
const openApiConfig = new DocumentBuilder()
|
||||
.setTitle("Image Platform API")
|
||||
.setDescription("Control plane for image assets, variants, S3 storage and external imgproxy.")
|
||||
.setVersion("0.1.0")
|
||||
.addTag("system")
|
||||
.addTag("assets")
|
||||
.addTag("variants")
|
||||
.addTag("allowed-hosts")
|
||||
.addTag("internal-images")
|
||||
.build()
|
||||
|
||||
const openApiDocument = SwaggerModule.createDocument(app, openApiConfig)
|
||||
|
||||
SwaggerModule.setup("docs", app, openApiDocument, {
|
||||
jsonDocumentUrl: "docs-json",
|
||||
swaggerOptions: {
|
||||
persistAuthorization: true,
|
||||
},
|
||||
})
|
||||
|
||||
const port = Number.parseInt(process.env.API_PORT ?? "3001", 10)
|
||||
|
||||
await app.listen(port)
|
||||
}
|
||||
|
||||
void bootstrap()
|
||||
Reference in New Issue
Block a user