Feature toggles in NodeJS

I had to implement a feature toggle recently.

What is a feature toggle?

I will keep it short. You have to add a new feature to your product, but you want that feature to be available only for certain type of users. What you do? Well, you just make an if check to see the user can see this feature and then you toggle it for him. Here is a sample check:

if(ToggleRouter.isEnabled("comments")) {
  // Display the feature to the user
Continue reading “Feature toggles in NodeJS”

Simple role management for SailsJS

You have probably heard this form me. I am working on a Sails js project and I wanted to implement a simple role management. That means that I have several routes like: “/admin”, “/login”, “/users” and I want the admin route  to be accessed only from admins, login to be accessed from admin and users and the users route to be accessed from only the users.

Continue reading “Simple role management for SailsJS”