javascript
Here are all the items relating to javascript (page 1 of 2)
Using AWS Cognito to Secure an ExpressJS API
Sunday, 8 July 2018
In recent articles, I have shown how to create a login screen using AWS Cognito, and validate the resulting JSON Web Token (JWT) using Javascript. This article brings those elements together, showing how we can use our AWS Cognito login screen to protect access to an API being served from an ExpressJS application.
Read More…
JWT Parsing with Javascript
Sunday, 17 June 2018
The previous two articles, showed how to create a login page using AWS Cognito, and how to break down the Json Web Token it produces. This article follows on from both of these, and shows how we can programmatically parse the JWT using Javascript.
Read More…
Automated Tweets with AWS Lambda and DynamoDB
Wednesday, 15 November 2017
Another article about Amazon Web Services (AWS), this time creating a Lambda (or Serverless or Function as a Service) which tweets about this very blog at regular intervals, using DynamoDB as its data store. I also use AWS Simple Notification Service (SNS) to trigger an e-mail to let me know the tweet has happened.
As an added bonus, there is also a refresher on functional programming in Javascript, and Javascript promises.
Read More…
A Clojurescript API Server in Docker using ExpressJS
Wednesday, 11 October 2017
I have been writing code in Clojure for some time, most recently running it in Docker containers on Kubernetes. This approach has been primarily for ease of testing and deployment, rather than for scaling. However, now I am looking at applications where I want to start scaling out dynamically, and I started to get a bit concerned about the startup time of my containers — the JVM that Clojure runs on, can take a bit of time to get out of bed. Since ClojureScript allows us to compile Clojure into Javascript, I took a look at running ClojureScript in NodeJS.
Read More…
A CD Pipeline in Amazon Web Services
Friday, 1 September 2017
In a previous article, I described serving a website from an S3 bucket, with CloudFront allowing us to apply SSL. This article looks at the other side of the process — how we populate the S3 bucket in the first place. I would typically use Jenkins to set up a build and deploy pipeline for this, but here I look at using the build tools AWS provides.
Read More…
Cross Framework Messaging
Wednesday, 20 January 2016
With the proliferation of Javascript frameworks, I found myself in the
situation where I needed two different UI elements — built with two different
Javascript frameworks — to communicate with each other.
Rather than choosing to migrate one onto a different framework, I looked at a
way of allowing them to send messages to each other using the Mediator Design
Pattern.
Using this pattern, I have an example of an Angular app, a React app, and a
plain Javascript app communicating.
Read More…
Very Light Javascript
Tuesday, 24 November 2015
I recently needed to put together a quick proof of concept for a small project
and decided to use this as an opportunity to try out a lighter than light
approach to Javascript I’d been thinking of for a while.
Whilst frameworks like Bootstrap are already quite light, I wanted to see if I
could remove even more. With all the Angular 2 kerfuffle, I wanted to look
for another framework which I can use instead. I also wanted to drop gulp
and just try using npm instead.
Read More…
Memoization
Monday, 14 September 2015
Some of my recent blog entries have dealt with using functional practices in Javascript. There are obviously downsides to functional programming as well, and one commonly stated one is around performance.
One area this applies to is in the large number of function calls resulting from this approach — particularly when we are writing recursive code.
We will give an example of this problem — calculating Fibonacci numbers — and then look at a technique known as memoization as a way of improving performance.
Read More…
Functional Example
Saturday, 12 September 2015
This blog entry will take the techniques discussed in the previous articles about functional Javascript and currying and apply them to an example problem.
Read More…
Curried Javascript
Tuesday, 8 September 2015
In my previous blog entry, we looked at how functions are first class entities in Javascript, what an anonymous (or lambda) function is, and how we create and use closures.
We will now look at another functional technique, known as currying, which builds on those concepts.
Read More…