Getting TypeScript Gatsby To Work With Environment Variables At Docker Run Time

Getting TypeScript GatsbyJS To Work With Environment Variables At Docker Run Time

What Is This?

If you haven’t read the problem and solution of the regular GatsbyJS version, I recommend you check out the original article.

This article will focus specifically on setting up the same environment but with TypeScript support.

Setting Up Our TypeScript Project

Using the Gatsby CLI, we’ll create a new project.

gatsby new gatsby-ts-env-vars;
cd gatsby-ts-env-vars;
yarn develop;

Once our project is setup, let’s add the necessary dependencies.

yarn add typescript gatsby-plugin-typescript;
yarn add -D @types/react-helmet;

Now we’ll configure Gatsby to support TypeScript.

File: gatsby-config.js

module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
description: `Kick off your next…


Getting GatsbyJS To Work With Environment Variables At Docker Run Time

Getting GatsbyJS To Work With Environment Variables At Docker Run Time

The Problem

Does Gatsby support environment variables? Yes, but only at build time.


Set Up Continuous Deployments With AWS CodePipeline To Elastic Beanstalk Docker

Continuous Deployments With GitHub, AWS CodePipeline, and AWS Elastic Beanstalk

What

If you haven’t checked out the first part of this walkthrough, take a look at the link below.

In this article we’re going to walkthrough the process of setting up AWS CodePipeline to automatically deploy our code from GitHub to our existing Docker environment on Elastic Beanstalk.

We’re going to skip the build process and address this in hopefully another walkthrough, but the main focus of this is just to automate our deployments.

Why

If you haven’t guessed, the main benefit is so that we’re not deploying things manually every time we have a new feature pushed to our GitHub repository…


How To Package A NodeJS TypeScript App, Build & Deploy The Docker Image To AWS Elastic Beanstalk

How To Deploy A TypeScript NodeJS App With Docker To Amazon Web Service Elastic Beanstalk

Why

I won’t dive into the benefits of TypeScript, so I’ll assume that you already have a NodeJS TypeScript application that you want to bundle as a Docker image and deploy to a hosting service that supports Docker.

Docker is the main reason.

Docker is the main reason for setting up our app because it gives us more control over the Linux environment, what is installed, what it can do, and not be at the mercy of a hosting provides own configured Linux box.

What We’re Accomplishing

This is a step-by-step guide on deploying NodeJS TypeScript Docker image on AWS Beanstalk. …


Building The ReactJS Frontend To Connect To Your Backend API

Amazon Product Wishlist App

What Are We Building

We’re building the frontend portion of the Amazon Wishlist App to allow you to search for Amazon products on Amazon.com and then add those items to your frontend we client.


Create An API That Scrapes Amazon.com With ReactJS & NodeJS

Amazon Product Wishlist App

What Are We Building?

Essentially what we are building is a way to ping Amazon.com’s website to be able to retrieve information that we need on products to be able to show on our own frontend.

Use-cases

This is a very simple base to be able to do some interesting things with their affiliate program or take advantage of being able to find information about specific products in more detail to use for your own internal app.

Some use-cases might include:

  • Creating your own Amazon Product Widget that shows products based on a set of keywords associated to your content
  • Creating a comparison tool to…


Photo by Nadya Spetnitskaya on Unsplash

Breaking Down The Steamroller Algorithm Problem From FreeCodeCamp.org

Goal

We’re going to examine the problem of trying to flattening arrays in JavaScript or the act of making a multidimensional array into a single dimensional array:

[1, [2], [3, [4]]] -> [1, 2, 3, 4]

Real World Use

In most cases I see this as a formatting issue or you need to get the data transformed into another form to easily access certain attributes. …


Three simple to advance hacks to writing Postman tests

Three simple to advance hacks to writing Postman tests

Audit Your API

Often when I’m working on a project, or even when I inherit and existing project, the first thing I look at is the API. It’ll give me insight as to how the payload is handled, what status codes to account for, what conventions are being followed, and more.

If you’re going to take on an existing project, it’s always a good idea to factor in an audit of the API, even if there is documentation.

Don’t always trust the API Documentation. Do an Audit.

A client may not like it, but it’s better to find out problems at the beginning…


How To Automatically Deploy React To Firebase Hosting With CircleCI

Deploy React To Firebase With CircleCI — How To Automatically Deploy React To Firebase Hosting With CircleCI

What We’re Doing

What we’re trying to do with this tutorial is to automate our code commits being tested and automatically deployed with CircleCI.

Why Though?

“Boils down to saving time.”

Sometimes developers don’t run unit tests and double check their code to make sure things are working correctly.

Requirements

  • NodeJS — 10.16.3
  • GitHub Account
  • CircleCI Account Linked With GitHub

Create React App

Let’s get started! We’re going to start by doing the basic the create-react-app:

npx create-react-app c;

Initial Jest Test

Once the app is scaffolded out, let’s try a simple test.

yarn run test --watchAll=false; # npm run test--watchAll=false;# Expected Output
# yarn run v1.16.0
# $ react-scripts test --watchAll=false
# PASS…


3 Ways to do Recursive HTTP requests with callbacks, promises, and async/await.

Recursive HTTP Requests With Callbacks, Promises, & Async/Await

Scenario

This will help you if in order for you to perform a task you need to gather a bunch of information in a specific order. Another scenario is that you need to automate a bunch of requests in a particular sequence. I’m going to cover the three ways to do this in a recursive function.

And yes I know there might be a more efficient way to do this GraphQL but that might not solve making multiple queries to multiple APIs.

API

For this tutorial, we’re going to use https://jsonplaceholder.typicode.com as our means to retrieve data.

Manny

Web Application / Full Stack JavaScript Developer & Aspiring DevOps

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