Skip to content

Commit

Permalink
Readme clarified and CircleCI badge added.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-szabo committed Apr 29, 2019
1 parent 959fcc9 commit d309b49
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
[![CircleCI](https://circleci.com/gh/freshautomations/aws-lambda-go-template/tree/master.svg?style=svg)](https://circleci.com/gh/freshautomations/aws-lambda-go-template/tree/master)

# AWS Lambda function template in Go

## Overview

This AWS Lambda function template in Go implements HTTP routing.
It can also be run as a stand-alone web service.
This AWS Lambda function template in Go
* implements HTTP routing using Gorilla/Mux
* reads configuration from environment variables
* it can also be run as a stand-alone web server
* the standalone web server can also read configuration from a file
* uses viper to allow YAML, JSON and other configuration file types.

## How to start developing with the template

## How to use locally
The template runs as-is as a "Hello world" application.
Add your custom code at the "// Todo:" comments to make it useful.

For developers, it is easiest to run the code locally as a web service:
* Build your functionality for the `/` page in the `MainHandler` function.
* Create additional web Handler functions and register them as a Gorilla/Mux route
in the `AddRoutes` function.
* Set configuration defaults for unset variables in the `main` function.
* Set a version number in the `main` function.

### Build

Expand All @@ -21,12 +34,12 @@ make build
build/mylambda -webserver
```

- it will run the local webserver on port 3000 and accept connections.
* it will run the local webserver on port 3000 by default.

```bash
curl localhost:3000
```

## How to use on AWS Lambda
The CircleCI configuration will deploy the code into AWS.
CircleCI has to have AWS access code ID and secret access key set up.
CircleCI has to have AWS access code ID and secret access key set up.

0 comments on commit d309b49

Please sign in to comment.