You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPMENT.md
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,23 +19,16 @@ Execute following command from the `sdk` folder to start testing.
19
19
npm run test
20
20
```
21
21
22
-
## Running sample angular app
22
+
## Building custom SDK for sample angular app
23
+
24
+
Repository to get sample app: https://github.com/imagekit-samples/quickstart
23
25
24
-
Every sample app requires a different version of Angular CLI. Please refer to the individual sample app `Readme.md` for details.
25
26
Before sample apps can be used, `imagekitio-angular` library needs to be packed and installed using the file system within the sample apps. Use the following steps to run any sample app.
26
27
27
28
1. In the `sdk` folder, install dependencies with `npm install`
28
29
2. Build library with `npm run build`
29
30
3. In the `sdk/dist/imagekitio-angular` folder, use `npm pack` to create a tarball with version mentioned in the current package.json for sdk.
30
-
4. Go to `samples/imagekitio-angular-sample` folder and use `npm install` to install dependencies.
31
-
5. Use `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-x.x.x.tgz` where x.x.x needs to be replaced with the current version. For example, SDK version is `0.0.1`, then above command becomes `npm install ../../sdk/dist/imagekitio-angular/imagekitio-angular-0.0.1.tgz`
31
+
4. Go to the Angular sample app's root folder and use `npm install` to install dependencies.
32
+
5. Use `npm install <path to this SDK>/sdk/dist/imagekitio-angular/imagekitio-angular-x.x.x.tgz` where x.x.x needs to be replaced with the current version. For example, SDK version is `0.0.1`, then above command becomes `npm install <path to this SDK>/sdk/dist/imagekitio-angular/imagekitio-angular-2.0.0.tgz`
32
33
6. Configure sample app with required keys. Use each app's `Readme.md` for exact details.
33
-
7. Use npm start from the `samples/imagekitio-angular-sample` folder to run the app for a particular angular version.
34
-
35
-
## Running sample backend server
36
-
37
-
Sample server for upload implementation is available at `samples/sample-server`. To run the server, follow these steps
38
-
39
-
1. Create a `.env` file based on `sample.env` and enter your private key.
40
-
2. Use `npm install` to install dependencies.
41
-
3. Use `npm run server` to start the server. It will expose the [authentication endpoint](https://docs.imagekit.io/api-reference/upload-file-api/client-side-file-upload#how-to-implement-authenticationendpoint-endpoint) on `http://localhost:3000/auth`
34
+
7. Use npm start from the Angular sample app's root folder to run the app
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -549,6 +549,11 @@ Sample Usage
549
549
| validateFile |Function callback |Optional. Called before the upload is started to run custom validation. The first and only argument is the file selected forupload. If the callback returns `true`, the upload is allowed to continue. But, if it returns `false`, the upload is not done |
550
550
| onSuccess |Function callback |Optional. EventEmitter. Calledif the upload is successful. The first and only argument is the response JSON from the upload API. The request-id, response headers, and HTTP status code are also accessible using the `$ResponseMetadata` key that is exposed from the [javascript sdk](https://github.com/imagekit-developer/imagekit-javascript#access-request-id-other-response-headers-and-http-status-code) |
551
551
| onError |Function callback |Optional. EventEmitter. Calledif upload results in an error. The first and only argument is the error received from the upload API|
552
+
| urlEndpoint |String|Optional. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/ |
553
+
| publicKey |String| Optional |
554
+
| authenticationEndpoint |String| Optional |
555
+
556
+
Note: All three `urlEndpoint`, `publicKey` and `authenticationEndpoint` must be present in the attribute for them to take effect. Otherwise, the SDK will fall back to the values specified in`app.module.ts`.
0 commit comments