Blog Insights
Node Reference - List Products
Prerequisites This article builds on the prior article: Node Reference - Monitoring. Add listing Clients of our service will need a way to find products. For that, we need a product listing service. DynamoDB provides an operation for listing the contents of a table called a 'scan'. (As a table or index grows,...Node Reference - CloudWatch
Monitoring How do we answer the question: "Is our application performing correctly?" With just one application server we could remotely log into the server, look at CPU and memory load, run grep{:target="_blank"} on the log files and then determine that everything is fine. This approach is manual intensive and obviously does not scale...Node Reference - Integration Tests
Prerequisites This article builds on the prior article: Node Reference - Validation. Add Integration or Smoke Tests So far, our testing strategy has consisted of only Unit Testing{:target="_blank"}, testing each module in isolation. While this type of testing covers most business logic, it does leave some gaps. It does not test that our modules interact...Node Reference - Validation
Prerequisites This article builds on the prior article: Node Reference - Put. Add model validation We now have a service that allows us to create product records but does not provide any mechanism for ensuring those products contain all the required data we need in the correct format. For this, we need data...Node Reference - Put Product
Prerequisites This article builds on the prior article: Node Reference - DynamoDB. Create put test/endpoint First, lets write a spec for our POST /products endpoint. Create a file called products/createProduct.spec.js with the following contents: const proxyquire = require('proxyquire'); describe('products', function () { describe('createProduct', function () { ...Node Reference - DynamoDB
Prerequisites This article builds on the prior article: Node Reference - Authentication. Add DynamoDB Before we can start building out our product endpoints, we need a place to store them. For that, we are turning to DynamoDB{:target="_blank"}. Tables are the main component, not a "database", so we can create just a single table....Node Reference - Authentication
Prerequisites This article builds on the prior article: Node Reference - Cognito. Adding authentication In order to leverage our new identity provider, we need to add a middleware into our Koa pipeline. This middleware will reject requests that do not contain valid tokens. We can accomplish this by using two libraries: koa-jwt{:target="_blank"} to validate...Node Reference - Cognito Setup
Cognito setup In order to secure our application we are going to leverage OpenID Connect{:target="_blank"}. Each request to our application from either another service or a logged in human user will contain a JSON Web Token (a.k.a. JWT){:target="_blank"} as a "Bearer" token in the Authorization{:target="_blank"} header{:target="_blank"}. This token not only proves...Node Reference - HTTPS
Prerequisites This article builds on the prior article: Node Reference - HTTPS/DNS{:target="_blank"}. HTTPS and DNS In this post we are going to add a friendly DNS address that can be used to invoke our service so that clients do not have to use the auto-generated AWS load balancer name. We will also need...Node Reference - Application Load Balancer
Prerequisites This article builds on the prior article about AWS Fargate. Add an Application Load Balancer For a long time, AWS has supported an HTTP(S) load balancing service in the form of an Elastic Load Balancer{:target="_blank"} (now called a "Classic load balancer"). When paired with ECS, a classic load balancer suffers from a...