RxJs is a really powerful library for doing reactive programming and working with data. Like any powerful library though we run into issues that might make us scratch our head if we haven’t seen before.
Say for example have a method in a service or controller in Angular that needs to return some data from an inner or nested subscribe.
If we try and do it like this, the method will try and return a subscription to the observable when we’re trying to return an observable with real data.
There are a few different ways to fix this, but…
Digital Ocean is a great platform that is super easy to use. They also have gotten in the habit of enforcing some best practices, and that includes forcing you to connect to your MongoDB instance with a certificate provided by Digital Ocean.
If you are running NestJS, it's pretty easy to get that certificate set up and connected to MongoDB.
Once you have created your MongoDB database, you should see an overview in the Digital Ocean app with some basic information about your database.
Among the sections, should be a Connection Details section, usually top-right.
Locate the blue link labeled…
This article will cover how to deploy an NX MonoRepo that uses NestJS for the backend and Angular for the front end. As a bonus, we’ll walk through setting up MongoDB as well. The good news is this is very quick and easy, from beginning to end this is about a 10 to 15 minute process.
For the purposes of the app we will be deploying, we will use a single Digital Ocean component to serve both the API and the static assets.
First, let’s get some assumptions out of the way. …
When I think of RxJs, I recall a quote from the late great Anthony Bourdain on China.
The one thing I know for sure about China is, I will never know China. It’s too big, too old, too diverse, too deep. There’s simply not enough time.
The same could be said for the impressive breadth and power of RxJs’s deep catalog of operators.
If you are new to RxJs and might be curious what benefits can be had from Reactive programming I suggest this well-written article from This Dot Media.
What seems like forever ago, I wrote about a simple and easy MVC pattern that can be used with Node and Express. As time went on, I have started to evolve the pattern to mimic patterns found in enterprise frameworks such as .NET Web API 2.
First a few disclaimers.
First, this really isn’t an MVC pattern because there is no view. It’s more of a MCS pattern, or Model > Controller > Store. That being said, we won’t be covering the Model portion of MCS, just controllers, and stores.
Second, focus on the pattern, not the code. It’s been…
As part of providing some API usage examples, I worked up an example that includes how to page through an Api using async/await. I won’t go to much into detail here since the pattern speaks for itself.
The code could be condensed and improved, but I left it verbose for clarity and its not really the point. For example, instead of doing:
let response = await reqUsers(token, offset)
We could refactor to this:
records.push.apply(records, await reqUsers(token, offset))
Without the use of Async/Await you would need a much clunkier pattern or recursion. …
This article is for anyone who has built an API in Node using Express and is interested in securing it based on the concept of Allowed Origins and CORS or Cross Origin Resource Sharing. You may have secured a good part of your application with token based authorization for an authenticated user or API key, but what about the parts of your application that rely on anonymous or semi-anonymous access? That’s where Allowed Origins come in.
When a consumer sends a request to the API, either through the browser, Postman or a program, the request will include a host in…
If you are reading this, you probably feel alone, angry, abandoned by our society. You, however, are not alone. I’m here to walk you through this journey of frustration. You have probably looked at dozens of GitHub and Stack Overflow issues, none providing you the oasis of a compiled binary.
Let’s see what we can do to help.
The error message you are probably seeing, or some variation of it (there are many:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
MSB8036: The Windows SDK version 8.1 was not found. …
This pattern still works and is effective, that being said I have an article that is in Alpha with a newer more complete pattern posted below
Now back to our regularly scheduled programming.
For some reason most examples of Node/Express MVC architecture are extremely over complicated, rely on third party packages, or are way to long and boring to follow.
All though this article is short and to the point, if you’re like me, you only really want an example that…
Sexy Input Styling Example with CSS
For the app I am currently making, I wanted to create transparent inputs with rounded corners and styled placeholders.
In researching how to do this, I found there was a surprisingly small set of nice examples for me too follow and very little information in general. Below is the look I was going for. Primarily, I wanted the background of the input transparent and rounded white borders. Additionally, I wanted the placeholder to standout and “fit” with the background and overall look.
How I made it (Gist)
The obvious thing to…
Developer at Knowledge Anywhere