WebTech


Posted by Steven

Recently, I added Spring HATEOAS to the IT Hub. Refactoring the controller to return RepresentationModel and CollectionModel, I noticed something odd. When returning a collection of items, in the returned JSON, the links for each item were represented under "links". When returning a single item, the links for this item were represented under "_links". This article briefly explains the reasons for this and how to fix it.

Posted by Steven

Working on new features for IT Hub Brunswick, I encountered a curious problem. Sending a POST request from the Angular 8 frontend to the Spring MVC backend returned incomplete header information. This article is about how to expose additional headers to the client.

Posted by Steven

Working on IT Hub, I recently had to find a way to reload images in this Angular Single Page Application. The new functionality I added allows an administrator to upload one image for each community group, so that each group has a logo. These images are displayed via a simple img tag in the HTML template:

Posted by Steven

In preparation for the upcoming IT Hub Brunswick Barcamp, I updated the conference page with ideas for talks and speakers. To display the speakers, we are using the PrimeNG Carousel. This component displays content using slide effects. For this component to work, the content has to be defined in the controller, not the HTML template.

Posted by Steven

As the main developer of IT Hub Brunswick, I created a TLS certificate for the domains www.ithubbs.de and ithubbs.de. In this article, I want to describe this process - mainly for future-me to be able to repeat this in the future. This is not an article about understanding the concepts in detail, it's just an overview.

Posted by Steven

Yesterday, we had flickering tests in our Angular application, which uses NgRx. Hopping from one test to the next and even sometimes running green, we had this error:

Uncaught TypeError: Cannot read property 'entities' of undefined

Here's the simple solution: Destroy the fixture after each test:

afterEach(() => {
  fixture.destroy();
});

 

Posted by Steven

Recently, my team and I had a discussion about naming conventions in TypeScript. The question was if to name observables with or without a dollar sign like this:

Posted by Steven

I spend the bigger part of yesterday figuring out why my Spring Boot app was not recognized as such in Pivotal Cloudfoundry app manager. The Spring Boot logo was not displayed in front of the app name and I couldn't configure the log levels or see the "Trace" and "Thread" tabs. Short answer: I used a custom context path. That doesn't work with the Actuator integration in Cloudfoundry. Read more for details ...

Posted by Steven

While writing some Protractor tests yesterday, I came across this error:

Posted by Steven

This will be a short one.

I am working on an Angular 6 application that is deployed on a Pivotal Cloud Foundry, using the nginx-buildpack. With the default nginx.conf, http and https requests are served. The https request is secured using the certificate for *cfapps.io, which is nice to have without any configuration.

However, allowing http requests opens the door for accidental unencrypted logins, which I want to avoid. Hence, I want to forward all http-requests to https.

Here's the working nginx.conf for this:

Pages