瀏覽代碼

add basic routes

main
Lennart Verschelden 2 年之前
父節點
當前提交
25a44bdc03
共有 1 個文件被更改,包括 30 次插入0 次删除
  1. 30
    0
      public/index.php

+ 30
- 0
public/index.php 查看文件

@@ -13,4 +13,34 @@ $app->get('/hello/{name}', function (Request $request, Response $response, array
return $response;
});

$app->get('/', function (Request $request, Response $response, array $args) {
$response->getBody()->write("index");
return $response;
});

$app->get('/blog/{slug}', function (Request $request, Response $response, array $args) {
$response->getBody()->write("Blog met slug");
return $response;
});

$app->post('/login', function (Request $request, Response $response, array $args) {
$response->getBody()->write("login");
return $response;
});

$app->post('/postcomment', function (Request $request, Response $response, array $args) {
$response->getBody()->write("Postcomment");
return $response;
});

$app->post('/blog/create', function (Request $request, Response $response, array $args) {
$response->getBody()->write("Blog create");
return $response;
});

$app->run();

Loading…
取消
儲存