summaryrefslogtreecommitdiff
path: root/htdocs/index.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-07-09 19:40:17 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-07-09 19:40:17 +0300
commitf7bfdf58def6aadc922e1632f407d1418269a0d7 (patch)
treed7a0b2819e6a26c11d40ee0b27267ea827fbb345 /htdocs/index.php
initial
Diffstat (limited to 'htdocs/index.php')
-rw-r--r--htdocs/index.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/htdocs/index.php b/htdocs/index.php
new file mode 100644
index 0000000..a1199da
--- /dev/null
+++ b/htdocs/index.php
@@ -0,0 +1,28 @@
+<?php
+
+require_once __DIR__.'/../init.php';
+
+$r = (new Router())
+ // route handler input
+ // ----- ------- -----
+ ->add('/', 'index')
+ ->add('contacts/', 'contacts')
+ ->add('projects.html', 'projects')
+ ->add('blog/(\d+)/', 'post_id id=$(1)')
+ ->add('([a-z0-9-]+)/', 'auto name=$(1)')
+
+ ->add('feed.rss', 'RSS')
+
+ ->add('admin/', 'admin/index')
+ ->add('admin/{login,logout,log}/', 'admin/${1}')
+
+ ->add('([a-z0-9-]+)/{delete,edit}/', 'admin/auto_${1} short_name=$(1)')
+ ->add('([a-z0-9-]+)/create/', 'admin/page_add short_name=$(1)')
+ ->add('write/', 'admin/post_add')
+ ->add('admin/markdown-preview.ajax', 'admin/markdown_preview')
+
+ ->add('uploads/', 'admin/uploads')
+ ->add('uploads/{edit_note,delete}/(\d+)/','admin/upload_${1} id=$(1)')
+;
+
+(new RequestDispatcher($r))->dispatch(); \ No newline at end of file