Just another post of how to do multiple indexes search.
To query elasticsearch result, that is use GET method with JSON data. Generally in REST API, we don't have body data in the GET method.
Direct upload to AWS S3.
Go to AWS cloudfront to create a new distribute.
Check New distribution.
What is Isomorphic Application?
Firstable, what is Isomorphic?
To be simple, that is to have the same result from different approaches.
In this case, we may easy to understand what is Isomorphic Application.
That could be an application with same results from different approaches.
One particular case for the web page is a web page generated from both client side and server side.
In the old days, server side technology to be used to generate a web page. That just has a lot of payload, like full HTML syntax, JS, and CSS. Search engine can understand that if content is all embedded inside HTML markup.
For the modern single page application (SPA), a big huge chunk of JS is loaded ahead of data. This is the way to minimum to payload and improve the user experience.
There are few of Isomorphic applications. The most popular for these days is React w/Next.
In Next, the first request page will be generated from the server side. In this case, search engine can understand page semantics. For the rest of clicking/action, the client side js is used in order to take advantage SPA. If any page refresh, once again the server rendering is triggered.
Install React code snippets extension to VSCode.
rcc-> == class component skeleton
rsc-> == stateless component skeleton
rsf-> == stateless named function skeleton
Apply static type to props with typescript.
Result:
1. React-admin missing X-total-count issue.
Need to fix it from server side response header in order to meet react-admin requirement.
To fix it, add extra response header: Category.tsx
2. Unable to update data if primary id also submit from data. typeORM only take ID from URL parameter, not from data.
[1] GET /api/categories?_end=10&_order=ASC&_sort=id&_start=0 200 1.591 ms - 390
[1] Caught Validation Error for /api/categories/undefined: { categoryId: { message: 'invalid float number', value: 'undefined' } }
[1] GET /api/categories/undefined 422 0.702 ms - 176
To fix it, tailor the submission data: category.router.ts
Solution 1. Just parse string into character array. Then, use another loop to compare the character with head to middle and tail to middle.
Solution 2. Optimize it. Only one while loop with one head index and the other tail index. That's the way to stand out.
When I put my bookstore project in gitbook, there were few links actually pointing back to my github project. I just curious how the markdown parser work in gitbook.
Today, I finally realize that gitbook take a link as same site reference only if this link in the left side menu. That's it need to be in SUMMARY.md.
Without input type
With input type
Correct the input foreign Key as type Int. They are categoryId, publisherId, authorId in BookInput.
arr = [[1,2,3],[4,5,6],[7,8,9]]
In javascript:
let flatList = arr.flat()
In python, my trick is walrus operator:
flat_list = []
[flat_list:=flat_list+sub for sub in arr]
arr = [[1,2,3],[4,5,6],[7,8,9]]
For javascript:
var result = 1 in arr.flat();
For python:
var result = any(1 in sub for sub in arr);
Just checked in linkedin profile today. And found my website thumbnail missing again.
Then double checked my gatsby source. That's fine.
I use linkedin link inspector: https://www.linkedin.com/post-inspector/inspect/
to check my website again : https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fccapeng.github.io
I did get some warning, but my profile thumbnail shown again.