Skip to content

Commit

Permalink
docs: update user info. update http server info
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewJBateman committed Jan 12, 2024
1 parent a5e7e15 commit f5580cb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
43 changes: 23 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
* Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
* Run `npm run build` for a production build with CSS purging.
* Run `npm run lint` to lint all files and fix where possible
* Run `http-server` to view build on an apple/android phone or simulator (pick 2nd http address supplied)
* The build artifacts will be stored in the `dist/angular-tailwind-unsplash` directory.

## :wrench: Testing
Expand All @@ -72,31 +71,35 @@
* `photo.service.ts` - code to fetch Unsplash photo data and return it as an Observable

```typescript
photoQuery(): Observable<any> {
return this.http
.get(
`${this.baseUrl}/photos/random?query=butterflies&orientation=landscape`,
httpOptions
)
.pipe(
take(1),
catchError((err) => {
return throwError(() =>
console.log(
'There was a problem fetching data from the Unsplash API, error: ',
err
)
);
})
);
}
photoQuery(options: { query: string; orientation: string }): Observable<any> {
const queryParams = new HttpParams()
.set('query', options.query)
.set('orientation', options.orientation);

return this.http
.get(`${this.baseUrl}/photos/random`, {
...this.httpOptions,
params: queryParams,
})
.pipe(
take(1),
tap(data => console.log(data)),
catchError(err => {
return throwError(
() =>
`There was a problem fetching data from the Unsplash API: ${err.error.errors.toString()}`
);
})
);
}
```

## :cool: Features

* Lazy-loading of About and Contact pages
* All 3 pages have good Lighthouse test scores
* Tailwind build for production CSS purge results in a very small styles bundle (about 7kB)
* Tailwind build for production CSS purge results in a very small styles bundle (about 2.13kB)
* CodiumAI used to improve and document code

## :clipboard: Status & To-Do List

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build --configuration production",
"server": "http-server -p 8080 dist/angular-tailwind-unsplash/browser",
"watch": "ng build --watch --configuration development",
"lint": "ng lint",
"lint:fix": "ng lint --fix",
Expand Down

0 comments on commit f5580cb

Please sign in to comment.