Browse Source

Merge pull request #15038 from abpframework/mini-update/add-dist-schematic

Add dist schematic
pull/15040/head
Muhammed Altuğ 3 years ago
committed by GitHub
parent
commit
c966197644
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      npm/ng-packs/package.json
  2. 10
      npm/ng-packs/scripts/mock-schematic/mock-schematic-json.ts

7
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": {

10
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);
});

Loading…
Cancel
Save