Skip to content

Instantly share code, notes, and snippets.

@muhammedaltug
Created July 19, 2022 10:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save muhammedaltug/8969dd3ea00e902b034c8a5743165248 to your computer and use it in GitHub Desktop.
Save muhammedaltug/8969dd3ea00e902b034c8a5743165248 to your computer and use it in GitHub Desktop.
Generating proxies in microservices
  1. Create an angular lib for microservice with command below
ng generate library my-service
  1. Add path for created lib to tsconfig.json
"paths": {
  // other paths
  "my-service": ["projects/my-service/src/public-api.ts"]
}
  1. Add api info to environment.ts file
  MyService: {
    url: 'https://localhost:$PORT'
    rootNamespace: '$ROOT_NAMESPACE',
  },
  1. Run proxy generation command
abp generate-proxy -t ng -m myService -u https://service-url --target my-service
  1. Export generated code in packages/my-service/src/public-api.ts
export * from './lib/proxy';

or

export * from './lib/proxy/my-service/index'';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment