goapi

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2023 License: Unlicense Imports: 16 Imported by: 0

README

GOAPI

A challenge to create a RESTAPI API service.

The service is bundle with 2 components

  1. The goapi server
  2. A redis that acts as its query store

TL;DR

To run it locally
  1. Run docker compose up -d
To Check the support api documentation
  1. Open your browser and navigate to http://localhost:3000/swagger/index.html
To deploy to a k8s cluster
  1. Run the following command to deploy
helm upgrade --install goapi ./charts/goapi \
  --namespace goapi \ 
  --create-namespace \
  -f helm/goapi/values.yaml
To run a local test as you code
  1. Run make test. This will target the 'test' target of the Dockerfile which perform simple go testing. It's compliant with rancher desktop, so it will replace docker with nerdctl.

Demo

Pre-requisite

  1. Install Rancher Desktop on your machine
  2. Deploy the helm chart to your k3s running on your machine

Accessing the Application

  1. You can reach out to the application by entering http://goapi.localdev.me, or
  2. curl
➜  ~ curl goapi.localdev.me
{"version":"0.1.0","date":1680761515,"kubernetes":true}%

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL