19 Dec 2022 to 25 Dec 2022
Weekly forecast
- Work on Resume and job hunting
I will fail often in order to succeed only once. —by OG Mandino
import will be changed to require(or add “type” : “module” to package.json)
import to be changed to require, export to be changed to
module.exports = { foo }
check Linkfor more details
node-fetch issue
latest version of node-fetch(as Dec 2022 version 3.30) does not support import with ‘require’
- need to to :
- change to version 2 with npm i node-fetch@2, then use require, or
- use axios instead of fetch, or
- change other require to import with add “type” : “module” in package.json (do not forget to npm install)
google map API best practice
For google map that needs to be rendered in frontend, a restricted API Key is recommended to be used, refer to link
- You can create multiple API keys with different restrictions to use them safely. For embedding a map, the Google Maps documentation has instructions for creating a correctly restricted API key so that it cannot be abused for other purposes at Get an API Key - Restricting API keys. It’s OK to include a restricted API key in your source code, because you cannot embed a map properly without doing that anyway.
restrict google map API key
AWS
S3
one zone infrequently access | S3 infrequent access | S3 glacier |
---|---|---|
30% cheaper | cheaper than S3 standard | for archive |
zone down then no access |
- DocumentDB has a 400KB max to upload files.
Weekly summary
- API key can be stored as environment parameter on AWS as backend deployment(amplify can handle the environment variables).likn