diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-01-05 15:58:24 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-03-27 18:44:50 +0200 |
commit | 68016e37983b882c51c6ac92da6f6cc1250676e5 (patch) | |
tree | 9f4f2cef8c8908f2f551f0678e4b6686de6dd5cc /index.php | |
parent | b320c860f5c794c57c08ee2a65c9b73768aac23c (diff) | |
download | Shaarli-68016e37983b882c51c6ac92da6f6cc1250676e5.tar.gz Shaarli-68016e37983b882c51c6ac92da6f6cc1250676e5.tar.zst Shaarli-68016e37983b882c51c6ac92da6f6cc1250676e5.zip |
REST API: implement POST link service
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2240,9 +2240,10 @@ $app = new \Slim\App($container); | |||
2240 | 2240 | ||
2241 | // REST API routes | 2241 | // REST API routes |
2242 | $app->group('/api/v1', function() { | 2242 | $app->group('/api/v1', function() { |
2243 | $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo'); | 2243 | $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo')->setName('getInfo'); |
2244 | $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks'); | 2244 | $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks')->setName('getLinks'); |
2245 | $this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink'); | 2245 | $this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink')->setName('getLink'); |
2246 | $this->post('/links', '\Shaarli\Api\Controllers\Links:postLink')->setName('postLink'); | ||
2246 | })->add('\Shaarli\Api\ApiMiddleware'); | 2247 | })->add('\Shaarli\Api\ApiMiddleware'); |
2247 | 2248 | ||
2248 | $response = $app->run(true); | 2249 | $response = $app->run(true); |