EwanValentine / serverless-api-example

Example of a Golang, Serverless API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverless API Example - Golang

See write up here: // Needs including

Architecture

This repo loosely follows Uncle Bob's clean architecture. The repo itself groups functionality related to a specific domain into its own package. In this case /users.

The delivery layers include http, so you can run this repo as a standard web server. Or as a Lambda router.

The business logic is written as use cases, and we include a repository for the data layer.

Running

Local

If you want to run it locally with a plain http server execute the following command:

$ make run-local // port 8005
$ curl localhost:8005 

Serverless

  1. Apply the example datastore with CloudFormation. This is required to provide an datastore with AWS DynamoDB for the Lambda Function to save data of the business logic.

  2. Deploy everything else Serverless: $ make deploy.

About

Example of a Golang, Serverless API


Languages

Language:Go 97.3%Language:Makefile 1.6%Language:Shell 1.1%