Skip to content

Go landing bootstrap with serve static, route for post form data and email sending over SendGrid. Based on iris

License

Notifications You must be signed in to change notification settings

DanilBorchevkin/golanding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golanding

This project is purposed to give some base for landing page serving.

How yo use it you can check it in own blog - Serve landing page with Go Iris backend on CentOS

License

BSD-2-Clause. Please see LICENSE file

Who develop this

Danil Borchevkin

What included

  • main.go - main itself

  • .env.example - example .env file for exporting enviroment variables (please see below)

  • /comingsoon/ - coming soon page for serving. It may use only as example of working

Bootstrap

Please check out the article Serve landing page with Go Iris backend on CentOS

Setup .env file

For using this code you should copy .env.example as .env and fill following variables:

  • STATIC_PATH - path where you store your landing page. If you have no suitable landing page you can use proposed comingsoon page with path ./comingsoon/

  • HTTP_PORT - port on which will expose a landing page. Usually 80

  • UPLOAD_PATH - path for uploads files. Don't forget create this folder!

  • SENDGRID_API_KEY - it's very obiviously

  • EMAIL_ADDRESS_FROM - address which wil be use as FROM in emails. You can set any email.

  • EMAIL_ADDRESS_TO - address which wil be use as TO in emails. This email should be exist.

  • DEBUG_LEVEL - debug level of the Iris framework. Equals to debug as default

Start program

As a peace a cake:

    go get
    go run main.go

.

Routes and data format

The app has only two routes:

  • / - at this route serves static content which placed at STATIC_PATH variable

  • /createlead - route for post data from form (values and file). Please check comingsoon/index.html for get some information about it.

Warnings and useful advices

  • Files in UPLOAD_PATH should be erased manually or by cron events

Feedback

About

Go landing bootstrap with serve static, route for post form data and email sending over SendGrid. Based on iris

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published