add signup resolver

This commit is contained in:
Lakhan Samani
2021-07-12 23:52:16 +05:30
parent 54bb923e9a
commit 04a522c947
19 changed files with 2828 additions and 311 deletions

36
server/constants/env.go Normal file
View File

@@ -0,0 +1,36 @@
package constants
import (
"log"
"os"
"github.com/joho/godotenv"
"github.com/yauthdev/yauth/server/enum"
)
var (
DB_TYPE = enum.Postgres
DB_URL = "postgresql://localhost:5432/postgres"
SMTP_HOST = ""
SMTP_PORT = ""
SENDER_EMAIL = ""
SENDER_PASSWORD = ""
JWT_TYPE = ""
JWT_SECRET = ""
FRONTEND_URL = ""
)
func init() {
err := godotenv.Load()
if err != nil {
log.Println("Error loading .env file")
}
SMTP_HOST = os.Getenv("SMTP_HOST")
SMTP_PORT = os.Getenv("SMTP_PORT")
SENDER_EMAIL = os.Getenv("SENDER_EMAIL")
SENDER_PASSWORD = os.Getenv("SENDER_PASSWORD")
JWT_SECRET = os.Getenv("JWT_SECRET")
JWT_TYPE = os.Getenv("JWT_TYPE")
FRONTEND_URL = os.Getenv("FRONTEND_URL")
}