I found a lot of tutorials explaining how to host React apps online. Some just explain how to copy everything in the build folder to a CDN and stop there, others use complete solutions such as Next.js to be able to do a lot more. I needed more than just a CDN, some logic was required for the routing. However I felt that Next.js was a bit overkill for my use case.

I picked Node.js with Express.js. The way I’ve set up this example makes sure this logic can be written in TypeScript (the same language I use for my…

In the previous post I’ve created a sample backend with Node.js and TypeScript that can store comments via a POST call on /comments. I included some standard error handling for incorrect JSON syntax, but it didn’t actually check if the fields defined in our interface existed and contained correct values. Let’s add some validation for that now. Also, add unit tests for all error scenarios we have covered so far, so that we don’t accidentally break these when we alter our code even more.

Grabbing the template from last blog post

If you didn’t follow the previous blog post, make sure you have:

The first thing you want to do after creating a hello world REST service using TypeScript, Node.js and Express.js is figure out how to let it consume and produce JSON.

Grabbing the template from last blog post

If you didn’t follow the previous blog post, make sure you have:

On GitHub, do a git clone https://github.com/Leejjon/node-ts-again and then switch to the 1.2 tag by running: git checkout tags/1.2

Verify that it works:

  • Run: npm install
  • Open a new terminal…

There are some guides already on how to set this up. I’m going to do exactly the same, but only add the stuff that I find useful and up to date as of July 2020.

  • Create a folder (I’m calling mine “node-ts-again”) in your workspace and browse to it via a terminal. I’m actually using Windows 7 as my PC died and I’m waiting for new laptop with Ubuntu to be delivered.
  • Run npm init -y
  • First add Express.js with npm i express

Add TypeScript to detect TypeErrors on compile time rather than runtime: npm i -D typescript

  • Add the…

In this post I’m going to show to set up Continuous Delivery for a simple Java micro service built with Maven. I’ll be using the sample project I have been using in five blog posts I wrote earlier this year, so if you wonder why things work the way they do in the sample project, read the previous blog posts.

I want that every commit to the master branch of my GitHub repository triggers a maven build in Cloud Build and that the produced jar files are deployed to App Engine.

Prerequisites

This is part four of this blog post. Here’s links to part one, two and three.

Tell Google your page is available in other languages

Even though Google’s web crawler is quite smart and should find the domains for each language, it helps if you tell Google you have different translations for your web page.

If you follow Google’s documentation, you see that on the English version of your site, you can add a link tag that tells Google there is a Dutch version:

<link rel="alternate" hreflang="nl" href="http://127.0.0.1/" />

NOTE: For those who didn’t follow part 1–3, I pretend that localhost is an english domain like example.com and 127.0.0.1…

This is part three of this blog post. Here’s links to part one and part two.

How to make page titles and metadata multilingual?

One of the challenges with modern Progressive Web Apps is SEO (Search Engine Optimization). Here’s an excelent article about what metadata tags you can use to increase your chances on being properly indexed in search engines like Google.

Our application is a “single page application” that handles the routing on the client side. …

You can find the first part of this post here.

Adding internationalization

There are a couple of internationalization aka i18n libraries for React. I picked react-i18next. It is a wrapper around i18next that makes it usable in React. “i18next” has it has good documentation and is the most downloaded internationalization library for React on npm. You can install it with: npm install i18next react-i18next

Create a file called i18n.ts

Mine looks like:

import i18n from "i18next";
import { initReactI18next } from "react-i18next";
// the translations // (tip move them in a JSON file and import them) const resources = { en: {…

Building the next big thing

So you finally have the idea for that web app that you want to make. It’s going to be the next Skype, Facebook, Tinder or Instagram. You could create it in your native language first and focus on obtaining market share in your own country. Testing if it’s a success before attempting to aim at the rest of the world. But then you take the risk that somebody copies your concept and goes international before you do.

Options for supporting multiple languages

If you look at other sites, there are different approaches for supporting multiple languages.

1 — Use one international brand name (“Google” or…

Earlier this year (2019) I started building a modular micro service with Jersey, the JAX-RS reference implementation. I wrote a few blog posts (1, 2, 3, 4 & 5) about it since then. In this post, we are going to create a simple index.html and try to fetch data from the Java backend, and see what we run into.

If you are only interested in reading how to allow cross origin requests in JAX-RS, scroll down.

Grabbing the template from last blog post

Make sure you have:

Leejjon

Java/TypeScript Developer. Interested in web/mobile/backend/database/cloud. Freelancing, only interested in job offers from employers directly. No middle men.

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