summaryrefslogtreecommitdiff
path: root/config/routes/wiki.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/routes/wiki.rb')
-rw-r--r--config/routes/wiki.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/config/routes/wiki.rb b/config/routes/wiki.rb
new file mode 100644
index 00000000000..dad746d59a1
--- /dev/null
+++ b/config/routes/wiki.rb
@@ -0,0 +1,19 @@
+WIKI_SLUG_ID = { id: /\S+/ } unless defined? WIKI_SLUG_ID
+
+scope(controller: :wikis) do
+ scope(path: 'wikis', as: :wikis) do
+ get :git_access
+ get :pages
+ get '/', to: redirect('/%{namespace_id}/%{project_id}/wikis/home')
+ post '/', to: 'wikis#create'
+ end
+
+ scope(path: 'wikis/*id', as: :wiki, constraints: WIKI_SLUG_ID, format: false) do
+ get :edit
+ get :history
+ post :preview_markdown
+ get '/', action: :show
+ put '/', action: :update
+ delete '/', action: :destroy
+ end
+end