]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
REST API: implement POST link service
[github/shaarli/Shaarli.git] / index.php
index 5c21c2f6a7f967c2f2f54e43225b22ec926248b5..021fc6e9a687a83ecbec98aa3a2f0928fb95bd1a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2240,9 +2240,10 @@ $app = new \Slim\App($container);
 
 // REST API routes
 $app->group('/api/v1', function() {
-    $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo');
-    $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks');
-    $this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink');
+    $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo')->setName('getInfo');
+    $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks')->setName('getLinks');
+    $this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink')->setName('getLink');
+    $this->post('/links', '\Shaarli\Api\Controllers\Links:postLink')->setName('postLink');
 })->add('\Shaarli\Api\ApiMiddleware');
 
 $response = $app->run(true);