Code Monkey home page Code Monkey logo

go-serverless's Introduction

Go Serverless

This is the demo project for serverless application written in GO =) Idea is to build an application which triggers workflow of several steps. This project follows Golang Project Layout

Project layout

  • cmd all the command handlers put there
  • cmd/orderApi implementation of lambda, which handles creation of order
  • deployments deployments are done via terraform
  • internal internal packages, which can be used across different handlers
  • mocks generated mocks
  • scripts various bash scripts
  • test handler tests
  • dist folder is used for placing deployable artifacts (like lambda zip files)

Usage

Prerequisites

  • docker & terraform need to be installed
  • AWS account access need to be configured

How to deploy

In order to deploy following command need to be run make dist deploy Terraform will ask for confirmation for creating required AWS resources. Type 'yes' to proceed URL of deployed api is provided in tf output https://api-url.execute-api.us-east-1.amazonaws.com/test/orders

How to test

Public endpoint is created on Amazon Api Gateway. In order to create order POST request need to be executed:
curl -v -X POST https://api-url.execute-api.us-east-1.amazonaws.com/test/orders
Expected that CREATED(201) is returned with Location header:
location: orders?id=<uuid>
TODO: unfortunately, full path is not returned so far.
Created resource can be requested via url
curl "https://api-url.execute-api.us-east-1.amazonaws.com/test/orders?id=<uuid>"

How to destroy

make destroy Terraform will ask for confirmation. Type 'yes' to destroy

go-serverless's People

Contributors

aandreev-aligntech avatar

Stargazers

 avatar

Watchers

James Cloos avatar Andrey Andreev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.