api

package
v0.0.0-...-a114734 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedHeaders = handlers.AllowedHeaders([]string{
	"Content-Type", "Authorization",
})

AllowedHeaders is a list custom headers accepted by the API

View Source
var AllowedMethods = handlers.AllowedMethods([]string{
	"GET", "POST", "PATCH", "DELETE",
})

AllowedMethods is a list containing all HTTP verb accepted by the API

View Source
var AllowedOrigins = handlers.AllowedOrigins([]string{
	"http://www.melvin.la",
	"http://orchid.melvin.la",
	"http://orchid.melvin.la:3000",
})

AllowedOrigins is a list containing all origins allowed to hit the API

Functions

func GetRouter

func GetRouter() *mux.Router

GetRouter return the api router with all the routes

func SetupIfNeeded

func SetupIfNeeded()

SetupIfNeeded parses the env, and sets the app globals

Types

type Args

type Args struct {
	Port            string `default:"5000"`
	PostgresURI     string `required:"true" envconfig:"postgres_uri"`
	TMDbAPIKey      string `envconfig:"tmdb_api_key"`
	LogEntriesToken string `envconfig:"logentries_token"`
	EmailAPIKey     string `envconfig:"email_api_key"`
	EmailFrom       string `envconfig:"email_default_from"`
	EmailTo         string `envconfig:"email_default_to"`
	Debug           bool   `default:"false"`
}

Args represents the app args

func Setup

func Setup() *Args

Setup parses the env, sets the app globals and returns the params

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL