Conversation
dv-blk
reviewed
May 13, 2018
Collaborator
dv-blk
left a comment
There was a problem hiding this comment.
Looks really good, sorry I don't have anything constructive to say, yet, though I am inspired to learn and write some go
| } | ||
|
|
||
| // GET /me | ||
| func (h *handler) getUser(c echo.Context) error { |
Collaborator
There was a problem hiding this comment.
(h * handler) is that like a decorator?
| }{us[0], gs, ss}) | ||
| } | ||
|
|
||
| // POST /me/goals |
Collaborator
There was a problem hiding this comment.
This is an interesting pattern, how you are defining routes in main and their functions separately, I like it.
| sess, _ := session.Get("session", c) | ||
| sess.Options = &sessions.Options{ | ||
| Path: "/", | ||
| MaxAge: 86400 * 7, |
Collaborator
There was a problem hiding this comment.
This is refreshing their session?
| // global middleware | ||
| e.Use(middleware.Logger()) | ||
| e.Use(middleware.Recover()) | ||
| e.Use(session.Middleware(sessions.NewCookieStore([]byte("big giant dick session secret")))) |
| e.Use(auth.CheckLogIn) | ||
|
|
||
| // static as | ||
| e.Static("/", "public") |
Collaborator
|
Everything is so terse, it's pretty cool that you have a whole api here in less than a couple thousand lines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🍆