rewrites.coffee 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. module.exports = [
  2. # show root
  3. { from: "/", to: "_show/index" }
  4. # static
  5. { from: "/static/*", to: "static/*" }
  6. # Spine adapter
  7. {
  8. from: "/spine-adapter/:type",
  9. to: "_update/spine_adapter_model",
  10. method: "POST"
  11. }
  12. {
  13. from: "/spine-adapter/:type/:id",
  14. to: "_update/spine_adapter_model/:id",
  15. method: "PUT"
  16. }
  17. {
  18. from: "/spine-adapter/:type/:id",
  19. to: "_update/spine_adapter_model/:id",
  20. method: "DELETE"
  21. }
  22. {
  23. from: "/spine-adapter/:type",
  24. # to: "_view/docs_by_type",
  25. # Using a list function to filter out large data attributes
  26. to: "_list/docs/docs_by_type",
  27. method: "GET",
  28. query: {
  29. startkey: [":type"],
  30. endkey: [":type", {}],
  31. include_docs: "true"
  32. }
  33. }
  34. {
  35. from: "/spine-adapter/:type/:id",
  36. to: "_view/docs_by_type",
  37. method: "GET",
  38. query: {
  39. startkey: [":type", ":id"],
  40. endkey: [":type", ":id", {}],
  41. include_docs: "true"
  42. }
  43. }
  44. # File attachments paths
  45. { from: '/file/:id/:filename', to: '../../:id/:filename' }
  46. # show color page
  47. { from: "/_color_samples", to: "_show/color_samples" }
  48. # catch all
  49. { from: "*", to: "_show/not_found" }
  50. ]