Skip to content

iugabogdan/docker-orchestration-node-express-jest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents
  1. ➤ About
  2. ➤ Technologies
  3. ➤ Prerequisites
  4. ➤ Scripts
  5. ➤ Folder Structure

-----------------------------------------------------

About

The scope of this repository is to act as support for this Medium Story and to demonstrate a simple way of how to orchestrate docker containers and validate your application in simple steps using Node, a basic Express server, Axios to trigger requests and Jest to execute your tests.

-----------------------------------------------------

Technology Stack

node.js npm express axios jest docker

-----------------------------------------------------

Prerequisites

  • Node (latest stable v16.17.0)
  • npm
  • Docker

-----------------------------------------------------

Scripts

$ npm install # will install all the dependencies on your machine
$ npm run start # will start the express server on your localhost
$ npm run test:local # will execute the tests against the server started on your localhost
$ npm run test:remote # will start two containers (one will boot the app - the other will execute the tests)

-----------------------------------------------------

Folder Structure

.
├── LICENSE
├── Makefile
├── README.md
├── application
│   └── app.js
├── docker
│   ├── application.Dockerfile
│   ├── docker-compose.yml
│   └── test-executor.Dockerfile
├── package-lock.json
├── package.json
└── tests
    ├── application-service.js
    ├── environment
    ├── environment.js
    ├── global-setup.config.js
    ├── jest.config.js
    ├── request.js
    └── test.spec.js