You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/pandelisz/serverless-go-forms

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/pandelisz/serverless-go-forms

v0.0.0-20180320175343-f97846e18e6f
Source
Go
Version published
Created
Source

Serverless forms with go

The endpoint currently supports POSTS with JSON payloads in the following format:

{
    "from": "sender@example.com",
    "message": "Hello there"
}

Or application/x-www-form-urlencoded content in the format

from=sender@example.com&message=Hello%20there

If you need to change this format for your needs you can edit lib/types/types.go

Configuration

go-forms currently supports mailgun with plans to support slack and regular smtp or amazon sqs.

You can configure your mailgun keys by renaming config.example.yml -> config.dev.yml and entering your details.

If you want to create a production config use config.prod.yml

CORS

If you want to lock down the requests to just your dowmain use the cors.origin setting in serverless.yml

Building and Deploying

This project can be deployed with the serverless framework.

To build binaries for deployment run make before deploying.

You willl also need go dep to install the vendor dependencies.

npm install -g serverless
make
serverless deploy

FAQs

Package last updated on 20 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts