Skip to content

Instantly share code, notes, and snippets.

@nosequeldeebee
Created August 22, 2018 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nosequeldeebee/5b2814375abb14caecf0b4182272eae2 to your computer and use it in GitHub Desktop.
Save nosequeldeebee/5b2814375abb14caecf0b4182272eae2 to your computer and use it in GitHub Desktop.
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal(err)
}
// Load API credentials
config = oauth1.NewConfig(os.Getenv("APIKEY"), os.Getenv("APISECRET"))
token = oauth1.NewToken(os.Getenv("TOKEN"), os.Getenv("TOKENSECRET"))
s := &http.Server{
Addr: os.Getenv("PORT"),
Handler: makeMuxRouter(),
ReadTimeout: 20 * time.Second,
WriteTimeout: 120 * time.Second,
MaxHeaderBytes: 1 << 20,
}
if err := s.ListenAndServe(); err != nil {
log.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment