node_modulesfolder with all related packages.
layer. Almost the same as the second way. But now,
node_modulesis not a part of the function code. The function will run on the layer.
In the article, we will not deep drive to explain this topic. Just…
In this article, we will talk about starting a project with Serverless and TypeScript. The article requires basic knowledge about AWS serverless architecture, the Serverless framework, and TypeScript.
We will use the latest stable version of Serverless (2.35.0) to build a “simple” serverless project — A REST API with AWS Lambda function and API gateway.
$ mkdir ts-jest-serverless
$ cd ts-jest-serverless
$ npm install serverless --no-save
Install the serverless package with
--no-save option to avoid creating
package.json file. In the next part, we will use a template to initiate the project.
This is an easy way…
Follow this example code, we are going to build a web service that includes an API. …
This is just my recommendation. I started working with Typescript in 2017, then I become a TypeScript lover. My team members love it too.
The primary benefits of using TypeScript are to catch more errors before they go into production and make it easier to work with your codebase.
As you know, jwt tokens are born as a stateless entity. By itself, we can validate a jwt token just by a secret token and its expire time.
However, sometimes our service requires a token to become stateful, which means we can make a jwt token to be invalid in our service.
A particular case is when your service user login to the service, the service will generate a jwt token for the user, and the user can use this token to authenticate for other requests. A user can use their credential (username/password) to get a new jwt token every…
This is a simple project — Writing an API service running on Nodejs. The service is a URL shortening service. The service also is an example of TDD style using Typescript, Jest, Express, and Mongoose.
This project will be base on TDD with Typescript and Jest: Starter project.
Just clone the starter project from Github:
$ git clone https://github.com/hoangsetup/ts-jest-tdd-starter.git url-shortener
$ cd url-shortener
$ npm ci
url-shortener is the name of this project. You also can update the project name in
First of all, let’s install some…
This is the first article to set up a backend project with Typescript end Jest.
It is not a series, but I will release some kind of articles about TDD with Typescript and Jest. This means, “re” write some examples by Typescript and follow TDD style. This article will become first for every article in the same category.
Let’s create a simple nodejs project with this command:
npm init -y
The command will generate
We will use Typescript in this project then
typescript is the first dependency.
npm install typescript -D
-D option means
typescript just use for…
Just A Cat Lover