summaryrefslogtreecommitdiff
path: root/main.go
AgeCommit message (Collapse)Author
14 hoursAdd missing `.` to log messagesxengineering
14 hoursDisable log timestampsxengineering
Many logging systems provide timestamps on their own. To avoid duplication it is disabled by default.
28 hoursSplit run() arguments into multiple linesxengineering
One line per argument makes the code more readable and also diffs in case arguments are changed.
28 hoursRun go fmtxengineering
28 hoursMake run fully configurablexengineering
This makes the run() function compared to main() useful at all since all parameters can be changed to test e.g. with unit tests.
28 hoursAdd handlers.goxengineering
This keeps the HTTP handlers in a separate file which registers the routes in an init() function. The main execution flow is still maintained in a now minimal main.go.
28 hoursRename srv to serverxengineering
This improves readability.
28 hoursRegister routes with init()xengineering
This makes the used *mux.Router from github.com/gorilla/mux a global variable. A new router is created in the line where the global variable is created. Handlers can be added across the code base in init() functions.
29 hoursAdd /versionxengineering
29 hoursLog HTTP URLxengineering
3 daysFix stop messagexengineering
3 daysAdd HTTP-based hello worldxengineering
This demonstrates the HTTP server is working.
3 daysLog start and stop of serverxengineering
3 daysIntroduce run() functionxengineering
This function should be called by main but can also be called by a unit test to run a server which might have different arguments which will likely be added.
3 daysAdd Go hello world programxengineering
This is a starting point to build the server.