# Intro to Amazon S3

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

I find myself facing a technology I knew I would eventually encounter: 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 research, I discovered that Amazon S3 is one of the best options available in terms of quality and price.

# CORS

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

CORS ScreenShot

I was unsure whether it was a backend or frontend problem. It turns out, this is a fairly common error faced by many new web developers.

The solution lies in configuring your server. You need to specify the origins (clients) that should be permitted. There’s a handy Node.js package called cors that simplifies the process. Just follow the instructions in the official documentation to install it.

Welcome to backend!

# 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; it 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 specific 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 repository with all the ideas and code demos: link.