httpapis-openapi-template

module
v0.0.0-...-15587a2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0

README

httpapis-openapi-template

This project provides a template for a Go based REST API hosted in AWS Lambda using API Gatway HTTPAPIs.

Prerequisites

Deployment

Update the project.mk file with APPNAME and MODULE_PKG used for your project.

make update-module

Create an .envrc file using direnv.

#!/bin/bash

export AWS_PROFILE=wolfeidau
export AWS_DEFAULT_PROFILE=wolfeidau
export AWS_REGION=ap-southeast-2
export DEPLOY_BUCKET=cf-templates-abc123-ap-southeast-2

To deploy the stack run.

make

Your now ready to hit the API 🎉

FAQ

Where are my cloudformation templates?

api.yaml

Where is the openapi spec?

api.yaml

Where is the lambda main function?

main.go

Whats is with the **-lambda convention for binaries?

Anything in cmd is compiled into a binary, those ending with -lambda are bundled into the handler.zip uploaded to AWS for deployment in cloudformation.

What is the lambda extras module you include and use in these lambdas?

Have a read of the https://github.com/wolfeidau/lambda-go-extras README and take a look at the references and examples.

Fork It And Make Your Own

You can fork this repo to create your own boilerplate.

Directories

Path Synopsis
cmd
api-lambda command
internal
api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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