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
BSD-2-Clause. Please see LICENSE file
-
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
Please check out the article Serve landing page with Go Iris backend on CentOS
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
As a peace a cake:
go get
go run main.go
.
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.
- Files in UPLOAD_PATH should be erased manually or by cron events
-
tech questions: Danil Borchevkin
-
administrative questions: Danil Borchevkin