The first step will be to create a method to guess if the HTTP request comes from HTTP or HTTPS (secure or not secure). In some context like AWS or Heroku you will have to ask by the header x-forwarded-proto instead of req.secure. Have in mind that req.secure will return always false if there is … Continue reading Redirect all requests from HTTP to HTTPS un Node.js and Express
Sometimes we need to configure a secure environment locally to test how our application reacts on HTTPS.
Formally, TDD means Test Driven Development but in your day by day means "to write tests before your main code". Let's use our random function example to explain TDD steps.
I know: there are several good modules in npm world but sometimes we don't have enough flexibility in terms of customizations. In my case I invested more time trying to tweak an existing module than develop my own
A simple example about how to connect to a PostgreSQL database using Node.js
A good sitemap.xml will help you a lot in terms of SEO. It's a nice starting point if you want to index your site. It's just a standard XML file that search engines understand.
Let's build a small site in Node.js using Express that will have one protected page Http auth basic prompt dialog We are going to use express generator to generate some scaffolding. If you didn't install it just type this command to install it globally but if you already know all this stuff you might skip … Continue reading Http auth basic in Node js and Express
Introduction A good practice in software development is to delegate as much heavy work as possible to background jobs to avoid blocking the main execution of your application that can be a web app, mobile app or desktop. Send email notifications it’s the typical scenario where you should execute it in background. More scenarios Image … Continue reading Better Queue in Node JS
In short, Prettier is a code formatter that supports many languages and can be integrated with most of editors.