Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

refactor source tree #321

Closed
wants to merge 1 commit into from

Conversation

mblakele
Copy link

This patch rearranges the source tree along the lines recommended by Glenn Lewis at https://groups.google.com/d/msg/google-appengine-go/dNhqV6PBqVc/ihzI5vgdE1EJ and discussed at #320. All the go code stays where it is, but imports change to use full paths. All the non-golang assets move into a new app subdirectory: yaml, js, css, templates, etc. HTTP routes are registered explicitly instead of happening automatically in init(). I think this is a minimal set of changes, but there may be a better way.

With these changes, goapp test and goapp test ./... both work. The app.yaml file is now in the app subdirectory, so use (cd app && goapp serve) to start the app.

@maddyblue
Copy link
Owner

What is the benefit to moving the http routes out of init()?

@mblakele
Copy link
Author

I might be missing something there: I found I had to move the init work into app.go or I'd just get 404s. I suspect setting up routes in imported inits just doesn't work with appengine and mux, but I haven't investigated.

maddyblue added a commit that referenced this pull request Dec 16, 2014
@maddyblue
Copy link
Owner

Yes, you're right. I've gone ahead and used your ideas to accomplish this, so I'm closing it. Thanks for the work and links.

@maddyblue maddyblue closed this Dec 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants