How To Create Golang REST API: Project Layout Configuration [Part 2]by@danstenger
3,107 reads
3,107 reads

How To Create Golang REST API: Project Layout Configuration [Part 2]

by Daniel6mApril 2nd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The Go application is now running in docker, can respond to code changes and reload for instant feedback. For handling http requests I will add another dependency, http router (mux) This is a lightweight, high performance HTTP request router that is easy to use and has everything most API's will need. I define all my routes in go/go and call handlers by explicitly passing application configuration so that each handler has access to things like database, configuration with env vars and more. I keep my handlers separate from router and group them under sub folders.

Company Mentioned

Mention Thumbnail
featured image - How To Create Golang REST API: Project Layout Configuration [Part 2]
Daniel HackerNoon profile picture
Daniel

Daniel

@danstenger

GO and functional programming enthusiast

About @danstenger
LEARN MORE ABOUT @DANSTENGER'S
EXPERTISE AND PLACE ON THE INTERNET.

Share Your Thoughts

About Author

Daniel HackerNoon profile picture
Daniel@danstenger
GO and functional programming enthusiast

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
L O A D I N G
. . . comments & more!