go-mux-api

command module
v0.0.0-...-e6c1d2b Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 9 Imported by: 0

README

Go Mux API Demo

Simple Go demo code. Use Go Mux to create an API server

It's a simple API used to demo how to deploy a production grade Golang API on AWS Elastic Container Service.

Project prerequisites

Run locally

To run these commands you must be in the repository’s root.

Environment variables

In order for you to run the application locally on your machine, you will need the following environment variables

Environment Variables
  • APP_DB_USERNAME - Database username
  • APP_DB_PASSWORD - Database password
  • APP_DB_NAME - Database name

You can export these env or create a env.sh file and source it.

Example

export APP_DB_USERNAME=app
export APP_DB_PASSWORD=pleasechangeme
export APP_DB_NAME=api
Docker-compose - Without Nginx Proxy

Build

docker-compose build

Run

docker-compose up

Server is listening on localhost:8080

Docker-compose - With Nginx Proxy

Build

docker-compose -f docker-compose-proxy.yml build

Run

docker-compose -f docker-compose-proxy.yml up

Server is listening on localhost:8000

License

Copyright (c) 2023 Calvine Otieno

Distributed under the MIT License. See the file LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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