https://github.com/mrbatista/loopback4-cloudfront
A loopback4 extension for AWS Cloudfront integration
https://github.com/mrbatista/loopback4-cloudfront
aws aws-cloudfront loopback loopback4 loopback4-extension
Last synced: about 2 months ago
JSON representation
A loopback4 extension for AWS Cloudfront integration
- Host: GitHub
- URL: https://github.com/mrbatista/loopback4-cloudfront
- Owner: mrbatista
- License: mit
- Created: 2021-04-12T08:31:42.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-10-27T09:58:30.000Z (over 3 years ago)
- Last Synced: 2025-08-09T10:34:10.038Z (7 months ago)
- Topics: aws, aws-cloudfront, loopback, loopback4, loopback4-extension
- Language: TypeScript
- Homepage:
- Size: 232 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# loopback4-cloudfront
## Installation
Install CloudfrontComponent using `npm`;
```sh
$ npm install loopback4-cloudfront
```
## Basic Use
Configure and load CloudfrontComponent in the application constructor
as shown below.
```ts
import {CloudFrontComponent, CloudfrontComponentOptions} from 'loopback4-cloudfront';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
constructor(options: ApplicationConfig = {}) {
// To configure component
this.configure(CloudFrontBindings.COMPONENT).to({
enableCloudFront: false, // Default to true
enableCloudFrontSigner: true // Default to false
});
// To configure Cloudfront
this.configure(CloudFrontBindings.CLOUD_FRONT_CONFIG).to(...);
});
// To configure Cloudfront Signer
this.configure(CloudFrontBindings.SIGNER_CONFIG).to({
keyPairId: 'your_keyPairId',
privateKey: 'your_privateKey',
});
});
this.component(CloudfrontComponent);
// ...
}
// ...
}
```