What if I tell you generating images is actually an easy task, and you can create a simple placehold.it clone with only a bunch of lines.…
Servers and APIs
In this example we’ll see how to create an HTTP API with 3 main components: Signup, Login and a login-only route. Let’s start by setting up a new project and including Express for handling the routes, JSON Web Token to handle auto-expiring tokens, and bcrypt to encrypt user passwords. Initialize the new project in an empty folder. We’ll name the main file
index.mjs to utilize top level awaits and have import/export functionality.