diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index a5a3963c1d..1bf16fa7d5 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -33,11 +33,12 @@ "postinstall": "node ./decorate-angular-cli.js && yarn compile:ivy", "build:schematics": "cd scripts && yarn && yarn build:schematics && cd ..", "dev:schematics": "tsc -p packages/schematics/tsconfig.json -w", + "mock:schematics": "cd scripts/mock-schematic && yarn && yarn start", + "debug:schematics": "./node_modules/.bin/ng g ./packages/schematics/src/collection.json:proxy-add --module __default --apiName __default --source __default --target __default --url https://localhost:44305 --serviceType application", + "debug:schematics-dist": "./node_modules/.bin/ng g ./dist/packages/schematics/collection.json:proxy-add --module __default --apiName __default --source __default --target __default --url http://localhost:4300 --service-type application", "ci": "yarn affected:lint && yarn affected:build && yarn affected:test", "lerna": "lerna", - "migrate-nx": "yarn nx migrate --run-migrations", - "mock:schematics": "cd scripts/mock-schematic && yarn && yarn start", - "debug:schematics": "./node_modules/.bin/ng g ./packages/schematics/src/collection.json:proxy-add --module __default --apiName __default --source __default --target __default --url https://localhost:44305 --serviceType application" + "migrate-nx": "yarn nx migrate --run-migrations" }, "private": true, "devDependencies": { diff --git a/npm/ng-packs/scripts/mock-schematic/mock-schematic-json.ts b/npm/ng-packs/scripts/mock-schematic/mock-schematic-json.ts index a4eb4f11d0..dcde74158e 100644 --- a/npm/ng-packs/scripts/mock-schematic/mock-schematic-json.ts +++ b/npm/ng-packs/scripts/mock-schematic/mock-schematic-json.ts @@ -1,11 +1,15 @@ -import express, { Request, Response } from 'express'; +import express, { Request } from 'express'; import fs from 'fs'; const port = 4300; const app = express(); -app.get('/api/abp/api-definition', async (req: Request, res: Response) => { - const file = fs.readFileSync('./api-definition.json'); +app.get('/', function(req:any, res:any){ + res.redirect('/api/abp/api-definition'); +}); + +app.get('/api/abp/api-definition', async (req: Request, res: any) => { + const file = fs.readFileSync('./api-definition.json'); res.contentType('application/json'); res.send(file); });