5 𝐟𝐫𝐞𝐞 𝐜𝐨𝐮𝐫𝐬𝐞𝐬 𝐭𝐡𝐚𝐭’𝐥𝐥 𝐡𝐞𝐥𝐩 𝐥𝐞𝐚𝐫𝐧 #javascript 10𝐱 𝐛𝐞𝐭𝐭𝐞𝐫 𝐭𝐡𝐚𝐧 𝐭𝐡𝐞 𝐏𝐚𝐢𝐝 𝐨𝐧𝐞𝐬🤩
𝑴𝒖𝒔𝒕 𝑺𝒂𝒗𝒆 𝒂𝒏𝒅 𝑺𝒉𝒂𝒓𝒆 !!!!
1) 𝐋𝐞𝐚𝐫𝐧 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐛𝐲 𝐒𝐜𝐫𝐢𝐦𝐛𝐚
👉 This is perhaps the most interactive JavaScript course ever recorded.
It contains 140+ coding challenges, meaning that you will finally build that ever-so-important JavaScript muscle memory.
🔗 https://lnkd.in/gkUvjJXC
2) 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐓𝐮𝐭𝐨𝐫𝐢𝐚𝐥 𝐟𝐨𝐫 𝐁𝐞𝐠𝐢𝐧𝐧𝐞𝐫𝐬 - 𝐅𝐮𝐥𝐥 𝐂𝐨𝐮𝐫𝐬𝐞 𝐢𝐧 12 𝐇𝐨𝐮𝐫𝐬 (2022)
👉 Best Free JavaScript Programming Course by Clever programmer
🔗 https://lnkd.in/gR-Ki4Uk
3) 𝐁𝐄𝐒𝐓 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐓𝐮𝐭𝐨𝐫𝐢𝐚𝐥 𝐟𝐨𝐫 𝐁𝐞𝐠𝐢𝐧𝐧𝐞𝐫𝐬 𝐟𝐨𝐫 𝐆𝐞𝐭𝐭𝐢𝐧𝐠 𝐚 𝐉𝐨𝐛 (𝐇𝐢𝐠𝐡 𝐐𝐮𝐚𝐥𝐢𝐭𝐲, 𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐁𝐚𝐬𝐞𝐝 𝐂𝐨𝐮𝐫𝐬𝐞)
👉 Build a full app in this JavaScript tutorial, designed to help new programmers get into the tech industry. Exercises, code, cheatsheet.
🔗 https://lnkd.in/gVXqp2ZY
4) 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐅𝐮𝐥𝐥 𝐂𝐨𝐮𝐫𝐬𝐞 2022 𝐛𝐲 𝐒𝐢𝐦𝐩𝐥𝐢𝐥𝐞𝐚𝐫𝐧
👉 This javascript tutorial for beginners focuses and major fundamentals to help you secure the right skills, tips, and tricks to be industry-ready according to the current IT standards.
🔗 https://lnkd.in/gVnc9fvn
5) JavaScript Crash Course by Codevolution
👉 This course will teach JavaScript from the bottom to the top.
It’s a gem!
🔗 https://lnkd.in/gcPNGJGD
for more such content.
#learningeveryday #javascriptdeveloper #javascript #frontend #react #developer #programming #learning #softwareengineering #coding #tech #engineering #engineer
𝑴𝒖𝒔𝒕 𝑺𝒂𝒗𝒆 𝒂𝒏𝒅 𝑺𝒉𝒂𝒓𝒆 !!!!
1) 𝐋𝐞𝐚𝐫𝐧 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐛𝐲 𝐒𝐜𝐫𝐢𝐦𝐛𝐚
👉 This is perhaps the most interactive JavaScript course ever recorded.
It contains 140+ coding challenges, meaning that you will finally build that ever-so-important JavaScript muscle memory.
🔗 https://lnkd.in/gkUvjJXC
2) 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐓𝐮𝐭𝐨𝐫𝐢𝐚𝐥 𝐟𝐨𝐫 𝐁𝐞𝐠𝐢𝐧𝐧𝐞𝐫𝐬 - 𝐅𝐮𝐥𝐥 𝐂𝐨𝐮𝐫𝐬𝐞 𝐢𝐧 12 𝐇𝐨𝐮𝐫𝐬 (2022)
👉 Best Free JavaScript Programming Course by Clever programmer
🔗 https://lnkd.in/gR-Ki4Uk
3) 𝐁𝐄𝐒𝐓 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐓𝐮𝐭𝐨𝐫𝐢𝐚𝐥 𝐟𝐨𝐫 𝐁𝐞𝐠𝐢𝐧𝐧𝐞𝐫𝐬 𝐟𝐨𝐫 𝐆𝐞𝐭𝐭𝐢𝐧𝐠 𝐚 𝐉𝐨𝐛 (𝐇𝐢𝐠𝐡 𝐐𝐮𝐚𝐥𝐢𝐭𝐲, 𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐁𝐚𝐬𝐞𝐝 𝐂𝐨𝐮𝐫𝐬𝐞)
👉 Build a full app in this JavaScript tutorial, designed to help new programmers get into the tech industry. Exercises, code, cheatsheet.
🔗 https://lnkd.in/gVXqp2ZY
4) 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐅𝐮𝐥𝐥 𝐂𝐨𝐮𝐫𝐬𝐞 2022 𝐛𝐲 𝐒𝐢𝐦𝐩𝐥𝐢𝐥𝐞𝐚𝐫𝐧
👉 This javascript tutorial for beginners focuses and major fundamentals to help you secure the right skills, tips, and tricks to be industry-ready according to the current IT standards.
🔗 https://lnkd.in/gVnc9fvn
5) JavaScript Crash Course by Codevolution
👉 This course will teach JavaScript from the bottom to the top.
It’s a gem!
🔗 https://lnkd.in/gcPNGJGD
for more such content.
#learningeveryday #javascriptdeveloper #javascript #frontend #react #developer #programming #learning #softwareengineering #coding #tech #engineering #engineer
Scrimba
Learn JavaScript for free - 7-hour interactive tutorial
Learn the basics of JavaScript by solving 140+ interactive coding challenges and building three fun projects.
REST APIs: The foundation of modern web development
As a software engineer, I have always been passionate about sharing my knowledge and helping others to understand complex technical concepts. That's why I was so excited to create this small presentation on REST API.
For those who may not know, a REST API (which stands for Representational State Transfer API) is a way for different software systems to communicate with each other through the internet.
It's a crucial component of modern software development, and something that every aspiring developer should understand.
Imagine you're trying to book a flight online. When you search for flights and enter your preferences, the website sends a request to the airline's computer system to find available flights that match your criteria. The airline's system then sends a response back to the website with the available flights, and you can choose one to book. This interaction between the website and the airline's system is made possible through a REST API.
There are five main methods used in a REST API:
GET - retrieves a specific resource or collection of resources
POST - creates a new resource
PUT - updates an existing resource
DELETE - removes a specific resource
PATCH - partially updates an existing resource
The response from a REST API can either be a success or an error. A success response typically includes the requested information or a message confirming that the requested action was completed. An error response includes a message explaining why the request could not be completed.
Overall, a REST API is a crucial tool for allowing different software systems to communicate with each other and exchange information seamlessly.
If you're working with software systems or just want to understand how different websites and apps work together, it's important to understand the basics of REST APIs.
I know firsthand how confusing and overwhelming it can be to learn about new technologies, especially when you're just starting out in the field. That's why I wanted to create this presentation - to provide a clear, concise, and easy-to-understand explanation of what a REST API is and how it works.
I hope that this presentation will be helpful to those who are new to software development, or who are simply looking to learn more about APIs. And I plan to keep creating more such documents in the future, so that all the needy and new enthusiasts out there can benefit from my knowledge and experience.
So if you're interested in learning more about APIs, or if you have any questions or feedback about this presentation, please don't hesitate to reach out. I'm always happy to help, and I'm committed to doing my part to make the world of software development more accessible and understandable to everyone.
📌 If you like my posts, please follow https://www.linkedin.com/in/aman-raj-6168b616a 🇺🇸 🌐🌐 and hit the 🔔 on my profile to get a notification for all my new posts.
#programming #coding #softwareengineering
As a software engineer, I have always been passionate about sharing my knowledge and helping others to understand complex technical concepts. That's why I was so excited to create this small presentation on REST API.
For those who may not know, a REST API (which stands for Representational State Transfer API) is a way for different software systems to communicate with each other through the internet.
It's a crucial component of modern software development, and something that every aspiring developer should understand.
Imagine you're trying to book a flight online. When you search for flights and enter your preferences, the website sends a request to the airline's computer system to find available flights that match your criteria. The airline's system then sends a response back to the website with the available flights, and you can choose one to book. This interaction between the website and the airline's system is made possible through a REST API.
There are five main methods used in a REST API:
GET - retrieves a specific resource or collection of resources
POST - creates a new resource
PUT - updates an existing resource
DELETE - removes a specific resource
PATCH - partially updates an existing resource
The response from a REST API can either be a success or an error. A success response typically includes the requested information or a message confirming that the requested action was completed. An error response includes a message explaining why the request could not be completed.
Overall, a REST API is a crucial tool for allowing different software systems to communicate with each other and exchange information seamlessly.
If you're working with software systems or just want to understand how different websites and apps work together, it's important to understand the basics of REST APIs.
I know firsthand how confusing and overwhelming it can be to learn about new technologies, especially when you're just starting out in the field. That's why I wanted to create this presentation - to provide a clear, concise, and easy-to-understand explanation of what a REST API is and how it works.
I hope that this presentation will be helpful to those who are new to software development, or who are simply looking to learn more about APIs. And I plan to keep creating more such documents in the future, so that all the needy and new enthusiasts out there can benefit from my knowledge and experience.
So if you're interested in learning more about APIs, or if you have any questions or feedback about this presentation, please don't hesitate to reach out. I'm always happy to help, and I'm committed to doing my part to make the world of software development more accessible and understandable to everyone.
📌 If you like my posts, please follow https://www.linkedin.com/in/aman-raj-6168b616a 🇺🇸 🌐🌐 and hit the 🔔 on my profile to get a notification for all my new posts.
#programming #coding #softwareengineering
One Diagram to Remember for C𝗼𝗱𝗲 R𝗲𝘃𝗶𝗲𝘄𝘀
An essential step in the software development lifecycle is code review. Code reviews are powerful means to improve code quality, establish best practices, opportunity to learn, and knowledge sharing and mentoring, as well as promotes team cohesion.
What to look for in a code review? Try to look for things such as 𝗱𝗲𝘀𝗶𝗴𝗻 (does this integrate well with the rest of the system and are interactions of different components make sense), 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝗮𝗹𝗶𝘁𝘆 (does this change is what the developer intended), 𝗰𝗼𝗺𝗽𝗹𝗲𝘅𝗶𝘁𝘆 (is this code more complex than it should be), 𝗻𝗮𝗺𝗶𝗻𝗴 (is naming good?), 𝗲𝗻𝗴. 𝗽𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲𝘀 (solid, kiss, dry), 𝘁𝗲𝘀𝘁𝘀 (are different kinds of tests used appropriately, code coverage), 𝘀𝘁𝘆𝗹𝗲 (does it follow style guidelines), 𝗱𝗼𝗰𝘂𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻, etc.
Code review is a conversation, not a queue of commands.
Code review checklist
A checklist helps you to create a structured approach to code reviews. Also, they remind you of all the quality checks you need to perform to approve code into the codebase.
𝟭. 𝗧𝗿𝘆 𝘁𝗼 𝗿𝗲𝘃𝗶𝗲𝘄 𝘆𝗼𝘂𝗿 𝗼𝘄𝗻 𝗰𝗼𝗱𝗲 𝗳𝗶𝗿𝘀𝘁
Before sending a code to your colleagues, try to read and understand it first. Then, search for parts that confuse you.
𝟮. 𝗪𝗿𝗶𝘁𝗲 𝗮 𝘀𝗵𝗼𝗿𝘁 𝗱𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻 𝗼𝗳 𝘄𝗵𝗮𝘁 𝗶𝘀 𝗰𝗵𝗮𝗻𝗴𝗲𝗱
It should explain what changes were at a high level and why those changes were made.
𝟯. 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗲 𝘄𝗵𝗮𝘁 𝗰𝗮𝗻 𝗯𝗲 𝗮𝘂𝘁𝗼𝗺𝗮𝘁𝗲𝗱
Leave to the system everything that can be automated,
PMD, FindBugs, and Checkstyle are the most popular open-source code analyzers,
Jenkins for CI-CD some code smells and bugs (SonarQube).
𝟰. 𝗗𝗼𝗻'𝘁 𝗿𝘂𝘀𝗵
You need to understand what is changed in every line of it. Read multiple times if required, class by class.
𝟱. 𝗖𝗼𝗺𝗺𝗲𝗻𝘁 𝘄𝗶𝘁𝗵 𝗸𝗶𝗻𝗱𝗻𝗲𝘀𝘀
Never mention the person (you), always focus on changes as questions or suggestions and leave at least one positive comment. Explain the "why" in your comments and suggestions for improving it.
𝟲. 𝗔𝗽𝗽𝗿𝗼𝘃𝗲 𝗣𝗥 𝘄𝗵𝗲𝗻 𝗶𝘁𝘀 𝗴𝗼𝗼𝗱 𝗲𝗻𝗼𝘂𝗴𝗵
Don't strive for perfection, but hold to high standards. Don't be a nitpicker.
𝟳. 𝗠𝗮𝗸𝗲 𝗿𝗲𝘃𝗶𝗲𝘄𝘀 𝗺𝗮𝗻𝗮𝗴𝗲𝗮𝗯𝗹𝗲 𝗶𝗻 𝘀𝗶𝘇𝗲
We should limit the number of lines of code for review in one sitting. Our brains cannot process so much information at once. The ideal number of LOC is 200 to 400 lines of the core at one time, which is usually 60 to 90 minutes.
8) Review logic, not semicolons
Automation reduces the needless checks and let's you focus on the logic behind the changes rather than syntax errors and typos.
What is your code review process? What works for you, and what does not?
Image credit (Code Review Pyramid): Gunnar Morling
#softwareengineering #programming #systemdesign #developers #bestpractice #coders #software #review #codereview
An essential step in the software development lifecycle is code review. Code reviews are powerful means to improve code quality, establish best practices, opportunity to learn, and knowledge sharing and mentoring, as well as promotes team cohesion.
What to look for in a code review? Try to look for things such as 𝗱𝗲𝘀𝗶𝗴𝗻 (does this integrate well with the rest of the system and are interactions of different components make sense), 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝗮𝗹𝗶𝘁𝘆 (does this change is what the developer intended), 𝗰𝗼𝗺𝗽𝗹𝗲𝘅𝗶𝘁𝘆 (is this code more complex than it should be), 𝗻𝗮𝗺𝗶𝗻𝗴 (is naming good?), 𝗲𝗻𝗴. 𝗽𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲𝘀 (solid, kiss, dry), 𝘁𝗲𝘀𝘁𝘀 (are different kinds of tests used appropriately, code coverage), 𝘀𝘁𝘆𝗹𝗲 (does it follow style guidelines), 𝗱𝗼𝗰𝘂𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻, etc.
Code review is a conversation, not a queue of commands.
Code review checklist
A checklist helps you to create a structured approach to code reviews. Also, they remind you of all the quality checks you need to perform to approve code into the codebase.
𝟭. 𝗧𝗿𝘆 𝘁𝗼 𝗿𝗲𝘃𝗶𝗲𝘄 𝘆𝗼𝘂𝗿 𝗼𝘄𝗻 𝗰𝗼𝗱𝗲 𝗳𝗶𝗿𝘀𝘁
Before sending a code to your colleagues, try to read and understand it first. Then, search for parts that confuse you.
𝟮. 𝗪𝗿𝗶𝘁𝗲 𝗮 𝘀𝗵𝗼𝗿𝘁 𝗱𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻 𝗼𝗳 𝘄𝗵𝗮𝘁 𝗶𝘀 𝗰𝗵𝗮𝗻𝗴𝗲𝗱
It should explain what changes were at a high level and why those changes were made.
𝟯. 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗲 𝘄𝗵𝗮𝘁 𝗰𝗮𝗻 𝗯𝗲 𝗮𝘂𝘁𝗼𝗺𝗮𝘁𝗲𝗱
Leave to the system everything that can be automated,
PMD, FindBugs, and Checkstyle are the most popular open-source code analyzers,
Jenkins for CI-CD some code smells and bugs (SonarQube).
𝟰. 𝗗𝗼𝗻'𝘁 𝗿𝘂𝘀𝗵
You need to understand what is changed in every line of it. Read multiple times if required, class by class.
𝟱. 𝗖𝗼𝗺𝗺𝗲𝗻𝘁 𝘄𝗶𝘁𝗵 𝗸𝗶𝗻𝗱𝗻𝗲𝘀𝘀
Never mention the person (you), always focus on changes as questions or suggestions and leave at least one positive comment. Explain the "why" in your comments and suggestions for improving it.
𝟲. 𝗔𝗽𝗽𝗿𝗼𝘃𝗲 𝗣𝗥 𝘄𝗵𝗲𝗻 𝗶𝘁𝘀 𝗴𝗼𝗼𝗱 𝗲𝗻𝗼𝘂𝗴𝗵
Don't strive for perfection, but hold to high standards. Don't be a nitpicker.
𝟳. 𝗠𝗮𝗸𝗲 𝗿𝗲𝘃𝗶𝗲𝘄𝘀 𝗺𝗮𝗻𝗮𝗴𝗲𝗮𝗯𝗹𝗲 𝗶𝗻 𝘀𝗶𝘇𝗲
We should limit the number of lines of code for review in one sitting. Our brains cannot process so much information at once. The ideal number of LOC is 200 to 400 lines of the core at one time, which is usually 60 to 90 minutes.
8) Review logic, not semicolons
Automation reduces the needless checks and let's you focus on the logic behind the changes rather than syntax errors and typos.
What is your code review process? What works for you, and what does not?
Image credit (Code Review Pyramid): Gunnar Morling
#softwareengineering #programming #systemdesign #developers #bestpractice #coders #software #review #codereview
Stay ahead of the curve in 2023 by learning GraphQL: the modern, flexible alternative to REST APIs.
As we gear up for another new year, I wanted to share some thoughts on a topic that I think will be crucial for developers in 2023: GraphQL.
If you're not already familiar with GraphQL, it's a query language for your API that allows clients to request exactly the data they need, and nothing more. This means that you can get all the data you need in a single request, rather than having to make multiple API calls to get all the data you need.
But why is this important? Well, for one thing, GraphQL can help improve the performance of your applications. With REST APIs, you often have to make multiple API calls to get all the data you need, which can be slow and resource-intensive.
With GraphQL, you can get all the data you need in a single request, which can greatly improve the performance of your application.
Another reason to learn GraphQL is that it can help improve the flexibility of your API. With REST APIs, you often have to design your API around the needs of your clients. This can be a problem if your clients have very different data needs, as you may have to design multiple endpoints to accommodate them all.
With GraphQL, clients can request exactly the data they need, which makes it much easier to design a flexible API that can accommodate a wide range of client needs.
So if you're a developer looking to stay on top of the latest trends in the field, learning GraphQL is definitely worth considering in 2023.
And if you're not familiar with the difference between REST APIs and GraphQL, the attached illustration should help demystify things for you.
Wishing you a very successful year ahead!
I hope this helps! Let me know if you have any questions or need further clarification.
📌 If you like my posts, please follow https://www.linkedin.com/in/aman-raj-6168b616a 🇺🇸 🌐🌐 and hit the 🔔 on my profile to get a notification for all my new posts.
#programming #coding #softwareengineering #api #graphql #developer
As we gear up for another new year, I wanted to share some thoughts on a topic that I think will be crucial for developers in 2023: GraphQL.
If you're not already familiar with GraphQL, it's a query language for your API that allows clients to request exactly the data they need, and nothing more. This means that you can get all the data you need in a single request, rather than having to make multiple API calls to get all the data you need.
But why is this important? Well, for one thing, GraphQL can help improve the performance of your applications. With REST APIs, you often have to make multiple API calls to get all the data you need, which can be slow and resource-intensive.
With GraphQL, you can get all the data you need in a single request, which can greatly improve the performance of your application.
Another reason to learn GraphQL is that it can help improve the flexibility of your API. With REST APIs, you often have to design your API around the needs of your clients. This can be a problem if your clients have very different data needs, as you may have to design multiple endpoints to accommodate them all.
With GraphQL, clients can request exactly the data they need, which makes it much easier to design a flexible API that can accommodate a wide range of client needs.
So if you're a developer looking to stay on top of the latest trends in the field, learning GraphQL is definitely worth considering in 2023.
And if you're not familiar with the difference between REST APIs and GraphQL, the attached illustration should help demystify things for you.
Wishing you a very successful year ahead!
I hope this helps! Let me know if you have any questions or need further clarification.
📌 If you like my posts, please follow https://www.linkedin.com/in/aman-raj-6168b616a 🇺🇸 🌐🌐 and hit the 🔔 on my profile to get a notification for all my new posts.
#programming #coding #softwareengineering #api #graphql #developer
𝗪𝗵𝗮𝘁 𝗶𝘀 𝗖𝗿𝗼𝘀𝘀-𝗢𝗿𝗶𝗴𝗶𝗻 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲 𝗦𝗵𝗮𝗿𝗶𝗻𝗴 (𝗖𝗢𝗥𝗦)?
Browsers use CORS, a method, to prevent websites from requesting data from different URLs. A request from a browser includes an origin header in the request message. The browser allows it if it gets to the server of the exact origin; if not, the browser blocks it.
We can deal with CORS issues on the backend. Cross-origin requests require that the values for origin and 𝗔𝗰𝗰𝗲𝘀𝘀-𝗖𝗼𝗻𝘁𝗿𝗼𝗹-𝗔𝗹𝗹𝗼𝘄-𝗢𝗿𝗶𝗴𝗶𝗻 in the response headers match and it is set by the server. When you add an origin to the backend code, the CORS middleware only permits this URL to communicate with other origins and utilize it for cross-origin resource requests.
There are two ways to fix CORS issues:
𝟭. 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗲 𝘁𝗵𝗲 𝗕𝗮𝗰𝗸𝗲𝗻𝗱 𝘁𝗼 𝗔𝗹𝗹𝗼𝘄 𝗖𝗢𝗥𝗦
Server can let all domains with 𝗔𝗰𝗰𝗲𝘀𝘀-𝗖𝗼𝗻𝘁𝗿𝗼𝗹-𝗔𝗹𝗹𝗼𝘄-𝗢𝗿𝗶𝗴𝗶𝗻: *. This actually turns off same-origin policy, which is not recommended. Another option would be only to allow particular domain, which is better option, e.g., 𝗔𝗰𝗰𝗲𝘀𝘀-𝗖𝗼𝗻𝘁𝗿𝗼𝗹-𝗔𝗹𝗹𝗼𝘄-𝗢𝗿𝗶𝗴𝗶𝗻: 𝗵𝘁𝘁𝗽𝘀://𝘀𝗼𝗺𝗲𝗱𝗼𝗺𝗮𝗶𝗻.𝗰𝗼𝗺.
𝟮. 𝗨𝘀𝗲 𝗮 𝗣𝗿𝗼𝘅𝘆 𝗦𝗲𝗿𝘃𝗲𝗿
We can use a proxy server to call external API. It acts as a middleware between client and the server. If server doesn't return proper headers defined by CORS, we can add then in the proxy.
#softwareengineering #programming #api #apidesign
Browsers use CORS, a method, to prevent websites from requesting data from different URLs. A request from a browser includes an origin header in the request message. The browser allows it if it gets to the server of the exact origin; if not, the browser blocks it.
We can deal with CORS issues on the backend. Cross-origin requests require that the values for origin and 𝗔𝗰𝗰𝗲𝘀𝘀-𝗖𝗼𝗻𝘁𝗿𝗼𝗹-𝗔𝗹𝗹𝗼𝘄-𝗢𝗿𝗶𝗴𝗶𝗻 in the response headers match and it is set by the server. When you add an origin to the backend code, the CORS middleware only permits this URL to communicate with other origins and utilize it for cross-origin resource requests.
There are two ways to fix CORS issues:
𝟭. 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗲 𝘁𝗵𝗲 𝗕𝗮𝗰𝗸𝗲𝗻𝗱 𝘁𝗼 𝗔𝗹𝗹𝗼𝘄 𝗖𝗢𝗥𝗦
Server can let all domains with 𝗔𝗰𝗰𝗲𝘀𝘀-𝗖𝗼𝗻𝘁𝗿𝗼𝗹-𝗔𝗹𝗹𝗼𝘄-𝗢𝗿𝗶𝗴𝗶𝗻: *. This actually turns off same-origin policy, which is not recommended. Another option would be only to allow particular domain, which is better option, e.g., 𝗔𝗰𝗰𝗲𝘀𝘀-𝗖𝗼𝗻𝘁𝗿𝗼𝗹-𝗔𝗹𝗹𝗼𝘄-𝗢𝗿𝗶𝗴𝗶𝗻: 𝗵𝘁𝘁𝗽𝘀://𝘀𝗼𝗺𝗲𝗱𝗼𝗺𝗮𝗶𝗻.𝗰𝗼𝗺.
𝟮. 𝗨𝘀𝗲 𝗮 𝗣𝗿𝗼𝘅𝘆 𝗦𝗲𝗿𝘃𝗲𝗿
We can use a proxy server to call external API. It acts as a middleware between client and the server. If server doesn't return proper headers defined by CORS, we can add then in the proxy.
#softwareengineering #programming #api #apidesign
Instead of learning solutions of LeetCode questions, understand patterns! 🙂
𝑴𝒖𝒔𝒕 𝑺𝒂𝒗𝒆 𝒂𝒏𝒅 𝑺𝒉𝒂𝒓𝒆 !!!!
For ex.
If input array is sorted then
- Binary search
- Two pointers
If asked for all permutations/subsets then
- Backtracking
If given a tree then
- DFS
- BFS
If given a graph then
- DFS
- BFS
If given a linked list then
- Two pointers
If recursion is banned then
- Stack
If must solve in-place then
- Swap corresponding values
- Store one or more different values in the same pointer
If asked for maximum/minimum subarray/subset/options then
- Dynamic programming
If asked for top/least K items then
- Heap
If asked for common strings then
- Map
- Trie
Else
- Map/Set for O(1) time & O(n) space
- Sort input for O(nlogn) time and O(1) space
Link : https://t.me/teamJavaHyd👈👈👈
Check out a GitHub repo by Sean Prasad if you're interested to read more about this, it's absolutely amazing!
#leetcode #placements #dsa #interview #coding #preparation #consistency #quality #programming #softwareengineering #india #competitiveprogramming #datastructures #algorithms #connections #interviewpreparation
𝑴𝒖𝒔𝒕 𝑺𝒂𝒗𝒆 𝒂𝒏𝒅 𝑺𝒉𝒂𝒓𝒆 !!!!
For ex.
If input array is sorted then
- Binary search
- Two pointers
If asked for all permutations/subsets then
- Backtracking
If given a tree then
- DFS
- BFS
If given a graph then
- DFS
- BFS
If given a linked list then
- Two pointers
If recursion is banned then
- Stack
If must solve in-place then
- Swap corresponding values
- Store one or more different values in the same pointer
If asked for maximum/minimum subarray/subset/options then
- Dynamic programming
If asked for top/least K items then
- Heap
If asked for common strings then
- Map
- Trie
Else
- Map/Set for O(1) time & O(n) space
- Sort input for O(nlogn) time and O(1) space
Link : https://t.me/teamJavaHyd👈👈👈
Check out a GitHub repo by Sean Prasad if you're interested to read more about this, it's absolutely amazing!
#leetcode #placements #dsa #interview #coding #preparation #consistency #quality #programming #softwareengineering #india #competitiveprogramming #datastructures #algorithms #connections #interviewpreparation