Giter Club home page Giter Club logo

demo-api's Introduction

Demo TypeScript API

A TypeScript API for demonstration purposes

Development

Requirements

  • Node 18+
  • Docker
  • Docker Compose

Quick Start

Install dependencies:

npm install

Execute unit tests:

npm test

Execute unit tests in watch mode:

npm run tdd

Execute spec tests to verify the API conforms to its OpenAPI specification:

npm run test-spec

Execute benchmark tests to measure throughput:

npm run test-benchmark

Execute component tests to verify end-to-end behavior using mocked dependencies:

npm run test-component

Execute verification tests to verify end-to-end behavior against the deployed service:

npm run test-verification

Run the api in watch mode:

npm run watch

Run the api in a container in watch mode:

npm run compose-dev

Build the Docker image:

docker build -t demo-api .

Setup a local Kubernetes cluster

Requirements

  • Minikube
  • Kubectl
  • Helm

Quick Start

Start a minikube cluster:

minikube start --driver=docker --cpus='max' --memory='max'

Build the Docker image and load it into the minikube cluster:

docker build -t demo-api .
minikube image load demo-api

Install the Helm chart into the cluster:

helm install demo-api ./charts/demo-api -f ./charts/demo-api/values.yaml

Forward local port 3000 to the service's port 80:

kubectl port-forward svc/demo-api 3000:80

Make a request to the service in another terminal:

curl http://localhost:3000/api/echo

demo-api's People

Contributors

adamrbennett avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.