Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

See `develop` branch for development

### Evidence links from task 2
Student: Jose cerón
2.1
-S3 link: https://myshopstorage.s3.amazonaws.com/index.html

2.2
-CLOUDFRONT: https://dhas39r8gef8j.cloudfront.net/

## Project setup
```
npm install
Expand Down
4,970 changes: 1,471 additions & 3,499 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"axios": "^0.21.1",
"core-js": "^3.6.5",
"material-design-icons-iconfont": "^6.1.0",
"serverless": "^2.35.0",
"serverless-finch": "^2.6.0",
"serverless": "^3.19.0",
"serverless-finch": "^4.0.0",
"serverless-single-page-app-plugin": "^1.0.4",
"vue": "^2.6.11",
"vue-i18n": "^8.24.2",
"vue-router": "^3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions serverless.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
service: node-in-aws-web

frameworkVersion: '2'
frameworkVersion: '3'

provider:
name: aws
Expand All @@ -18,7 +18,7 @@ plugins:

custom:
client:
bucketName: node-in-aws-web-bucket
bucketName: node-in-aws-web-bucketjc1
distributionFolder: build
s3BucketName: ${self:custom.client.bucketName}

Expand Down
4 changes: 2 additions & 2 deletions src/api/product-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const fetchAvailableProducts = async (): Promise<Product[]> => {

const fetchProducts = async (): Promise<Product[]> => {
return axios
.get(`${API_PATHS.bff}/product`)
.then(res => res.data)
.get(`${API_PATHS.bff}/products`)
.then(res => res.data.products)
.catch(e => {
console.error(e);
// << !!! mocks if any error !!!
Expand Down
7 changes: 4 additions & 3 deletions src/constants/api-paths.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export const API_PATHS = {
product: 'https://.execute-api.eu-west-1.amazonaws.com/dev',
product: 'https://h3ks8t1bmi.execute-api.us-east-1.amazonaws.com/dev',
order: 'https://.execute-api.eu-west-1.amazonaws.com/dev',
import: 'https://.execute-api.eu-west-1.amazonaws.com/dev',
bff: 'https://.execute-api.eu-west-1.amazonaws.com/dev',
import: 'https://h3ks8t1bmi.execute-api.us-east-1.amazonaws.com/dev',
bff: 'https://h3ks8t1bmi.execute-api.us-east-1.amazonaws.com/dev',
// bff: 'https://.execute-api.eu-west-1.amazonaws.com/dev',
cart: 'https://.execute-api.eu-west-1.amazonaws.com/dev',
};
2 changes: 1 addition & 1 deletion src/locale/messages/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"app": {
"title": "My store!",
"title": "CO Store",
"loading": "Loading... Please wait"
},
"common": {
Expand Down
4 changes: 2 additions & 2 deletions src/views/ProductImport/ui/CSVFileUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ const fetchPresignedS3Url = (url: string, fileName: string) => {
const uploadFileBy = async (url: string, file: File) => {
const destUrl = await fetchPresignedS3Url(url, file.name);

console.info('Uploading to: ', destUrl.data);
console.info('Uploading to: ', destUrl.data.url);

// save
const result = await fetch(destUrl.data, {
const result = await fetch(destUrl.data.url, {
method: 'PUT',
body: file,
});
Expand Down
2 changes: 1 addition & 1 deletion src/views/ProductShowcaseIndex/ProductShowcaseIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default Vue.extend({
this.isFetching = true;

productApi
.fetchAvailableProducts()
.fetchProducts()
.then(products => {
this.products = products;
})
Expand Down