-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update routes file when coast gen route is called #89
Comments
This is pretty much the main blocker before next is merged into master and then from there I'll work on updating the docs |
I'm more inclined to adding the (ns routes.todo
(:require [coast :refer [routes]))
(def todo-routes
(routes
[:get "/todo" index]
[:get "/todo/build" build]
[:post "/todo" create]
(middleware todo/set-todo
[:get "/todo/:id" show]
[:get "/todo/:id/edit" edit]
[:patch "/todo/:id" patch]
[:delete "/todo/:id" delete]))) And add the (ns routes
(:require [coast :refer [routes middleware]
[routes.home :as home]
[routes.todo :refer [todo-routes]]))
(def app
(routes
home-routes
todo-routes)) The reason is that I don't always need to include the whote routes into the app. Also, this seems a lot easier to implement 😛 |
It's funny you mention that, because that's what the next branch does now, in that case, I'll leave it and I mean if you want all of the routes in one file, you can put them there, it just won't happen by default |
🙌 🙌 🙌 |
Right now you have to manually update the
routes.clj
file, that stinks.Ideally, coast would just insert the new default routes when
coast gen route todo
is run.Kind of related to #87 but much smaller in scope
The text was updated successfully, but these errors were encountered: