Skip to content

retgits/serverless-contactform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serverless-contactform - A serverless app to serve the contactform

A serverless app designed to serve a contactform, running on ZEIT

Layout

.
├── .env_template <-- A template file with the environment variables needed for the function
├── .gitignore    <-- Ignoring the things you do not want in git
├── go.mod
├── go.sum
├── index_test.go <-- Tests for the function code
├── index.go      <-- The actual function code
├── LICENSE       <-- The license file
├── Makefile      <-- Makefile to build and deploy
├── now.json      <-- Deployment descriptor for ZEIT
└── README.md     <-- This file :)

Installing

Get the sources

You can get the sources for this project by simply running

go get -u github.com/retgits/serverless-contactform/...

Update secrets

Update the secrets by running

make update-secrets

This command will delete and recreate the secrets. The secrets used are:

  • RECAPTCHA_SECRET: The reCAPTCHA secret token you can get from the Server side integration step in Google reCAPTCHA
  • EMAIL_ADDRESS: The email address to send data to (like [email protected])
  • EMAIL_PASSWORD: The password needed to log in to the SMTP server
  • SMTP_SERVER: The SMTP server
  • SMTP_PORT: The SMTP server port

Deploy

Deploy the app by running

make deploy