Deep linking with Angular and Go

A Golang Gopher made to look like Kanye West in the Rolling Stone photo shoot for “808s and Heartbreak”
A Golang Gopher made to look like Kanye West in the Rolling Stone photo shoot for “808s and Heartbreak”
Heartless

Congratulations! You’ve been working really hard on building a beautiful Angular application, and you’re ready to move from your old friend ng serve on localhost:4200 to a production deployment. You’ve configured the Go HTTP server to serve static files, and it’s time to test it out. You navigate to the app root, click around your app and everything looks great! That is, until you try a browser refresh.


A full-stack reactive application walkthrough, built with Spring Boot 2, Angular 8, and MongoDB.

Photo by israel palacio on Unsplash

Introduction

I have found it challenging to learn reactive programming models, and to change the way I think from writing an imperative set of instructions to building an event-based non-blocking system where data is allowed to flow freely from one component to another. It is relatively simple for me to understand something like:

find a record using some criteria and return it

whereas a more reactive flow such as:

open a subscription and watch changes to this type of record, and expose the subscription to other interested components

is much more conceptually difficult.

In this article we will explore a simple…


Hello Darkness My Old Friend

Docker is amazing. It has absolutely revolutionized the development, deployment, and management of applications. I use it every single day.

Gone are the days of downloading some version of Postgres or MySQL, running through the install instructions, and manually setting up the database to accept connections from your app. Now we can just pull the image, seed the database with some initialization scripts, and voila! We’re up and running in no time, with very little busy work. It’s fast, repeatable, and comparatively painless.

But something happens after running Docker images for a while. The disk footprint starts to build up…


Photo by Jason Leung on Unsplash

You created an Angular library, and you published it to an npm registry. Now you’re ready to use the library in an application. Everything works exactly like you intended, and you’re feeling pretty confident. It’s time to put your production environment settings to the test, and get ready for deployment.

You run:

ng build --prod

Things are looking good for a while, and then you see a most unhelpful message:

The unhelpful stack trace

Let’s highlight the error for clarity:

ERROR in : Unexpected value ‘undefined’ imported by the module ‘MyLibraryModule in /build/src/node_modules/my-lib/my-lib.d.ts’

Ok. Now what happened? Everything worked fine…


Modules have greatly improved the dependency management process in Go. If you are new to Go Modules, and you would like to read more about how to get started, check out the official documentation.

If you’re looking for IDE recommendations for Go, this is a good comparison:

Once everything is configured correctly, it’s pretty straightforward to include specific versions of Go packages from public repositories. One of my typical starting points might look something like this:

What if we want to extend this behavior to import Go packages from private repositories? It’s pretty simple, really: make sure your Go…


How Can Kubernetes Check Liveness Under These Conditions?

TL;DR

When running a container based on the Docker scratch image in Istio with mutual TLS turned on, it is not clear how to enable Kubernetes liveness and readiness probes. One way to do this is to create a Go application that Kubernetes can call directly with an exec command.

Check out the repo on Github for an extremely simple example.

Background

A fundamental building block of Kubernetes container orchestration is the liveness probe. This is how Kubernetes knows when it needs to terminate and replace a particular container. …

Tim Jones

I like to build things and put them in clouds. I try to write about non-intuitive solutions to problems I run into along the way.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store