From 5c828d6f8113996e45d91e30969b3a412bdafff3 Mon Sep 17 00:00:00 2001 From: leostar Date: Fri, 12 Jul 2024 12:10:10 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20fix=20workflow=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{test.yml => ci.yml} | 2 +- apps/server/test/app.e2e-spec.ts | 8 ++++++++ package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) rename .github/workflows/{test.yml => ci.yml} (98%) diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 98% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index 029359cd..e99cb7bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test +name: CI on: push: diff --git a/apps/server/test/app.e2e-spec.ts b/apps/server/test/app.e2e-spec.ts index 7fd1b831..11cc7e06 100644 --- a/apps/server/test/app.e2e-spec.ts +++ b/apps/server/test/app.e2e-spec.ts @@ -3,6 +3,7 @@ import { INestApplication } from '@nestjs/common'; import * as request from 'supertest'; import { AppModule } from '../src/app/app.module'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; +import { appGlobalMiddleware } from 'src/app/useGlobal'; describe('AppController (e2e)', () => { let app: INestApplication; @@ -13,6 +14,13 @@ describe('AppController (e2e)', () => { }).compile(); app = moduleFixture.createNestApplication(); + app.enableCors({ + origin: [ + /^http:\/\/localhost(:\d+)?$/, + /^http:\/\/poster-craft\.leostar\.top(:81)?$/, + ], + }); + appGlobalMiddleware(app); const config = new DocumentBuilder() .setTitle('PosterCraft Swagger') .setDescription('The PosterCraft API description') diff --git a/package.json b/package.json index 9a011c23..7576efe3 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "homepage": "https://github.com/ileostar/PosterCraft", "engines": { - "node": ">=20.12.2" + "node": ">=20" }, "scripts": { "schema:build": "pnpm -F @poster-craft/schema build",