# Intro to Amazon S3

I’ve been working on my recipes project for the past few weeks, and it has been an incredible opportunity to delve deeper into Vue.js and other related technologies.

But now, I find myself facing a reality I knew would eventually come: AWS.

In order to store the images uploaded by users from the client and retrieve them later for display, I needed a reliable storage service. After careful research, I discovered that Amazon S3 is, in fact, one of the best options available in terms of quality and price.

Feel free to explore the final result of the recipes project here.

# CORS

Yesterday, I faced a CORS (Cross-Origin Resource Sharing) related issue. I got this error:

CORS ScreenShot

At that moment, I was unsure whether it was a backend or frontend problem, and I had no clue how to resolve it. As it turns out, this is a fairly common error faced by many new web developers.

To fix this, the solution lies in configuring your server. You need to specify the origins that should be permitted. Fortunately, there’s a handy Node package called cors that simplifies the process. Just follow the instructions in the official documentation to install it.

Yeah…welcome to backend!

# Random concepts

Below some programming concepts that I wanted to define in my own words: (pending)

  • Inheritance
  • Polymorphism
  • Server-side rendering: I have an excellent analogy for SSR understanding.
  • MVC pattern

MVC Pattern

# Getting started with Node.js

I started to learn Node.js this week. Here are some definitions/ideas that I consider key: (Defined in my own words)

  • Node.js is not a language, is a JavaScript runtime.
  • NPM stands for “Node Package Manager”. You get it by default when you download node.
  • Modules (aka libraries) are just JavaScript files that have an export.
  • __dirname and __filename are always-available variables within every module.
  • Middleware functions are modules that allow code abstraction for callbacks and validations.
  • Callbacks are functions that are passed in as arguments to other functions and are executed at a conditional given time. Any function can become a callback.

Some additional useful tips:

  • The nodemon dependency is a practical tool for updating the changes we make in our code without restarting the server.
  • This is a complementary read about the web browser rendering process: link.
  • Here is the project repository with all the ideas and code demos: link.