Skip to content

Commit

Permalink
Merge pull request #13 from aloatias/development
Browse files Browse the repository at this point in the history
Docker configuration
  • Loading branch information
aloatias authored Aug 9, 2020
2 parents 3503381 + 4fb9622 commit 22c9424
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
3 changes: 3 additions & 0 deletions DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM nginx
COPY nginx.conf /etc/nginx/nginx.conf
COPY /dist/google-books-app /usr/share/nginx/html
13 changes: 13 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
events{}
http {
include /etc/nginx/mime.types;
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
}
13 changes: 3 additions & 10 deletions src/app/book-details/book-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
import { BooksService } from '../books.service';
import { FormGroup, FormControl } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { IBookDetails } from '../Dtos/IBookDetails';

@Component({
selector: 'app-book-details',
Expand Down Expand Up @@ -64,7 +63,7 @@ export class BookDetailsComponent implements OnInit {
this.bookForm.patchValue(book);

this.setPriceMessage();
this.setAuthorMessage(book);
this.setAuthorMessage(book.authors);
this.setPublisherMessage();
});
});
Expand All @@ -74,14 +73,8 @@ export class BookDetailsComponent implements OnInit {
this.publisherText += this.bookForm.value.publisher;
}

private setAuthorMessage(book: IBookDetails) {
for (let i = 0; i < book.authors.length; i++) {
this.authorsText += book.authors[i];

if (i + 1 < book.authors.length) {
this.authorsText += this._commaSeparator;
}
}
private setAuthorMessage(authors: string[]) {
this.authorsText = authors.join(", ");

// Replace last ", " for " and "
var n = this.authorsText.lastIndexOf(this._commaSeparator);
Expand Down
3 changes: 2 additions & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const environment = {
production: true
production: true,
url: "https://localhost:5001/"
};

0 comments on commit 22c9424

Please sign in to comment.