commit fda097ccd5e6fd43445ebf3ebbab39fceebdd0b6
parent 053441280a01db84e059f15299f3708d20ba80ab
Author: MTRNord <mtrnord1@gmail.com>
Date: Tue, 3 Feb 2015 08:56:17 +0100
now it should work correct
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/core/api/v1/api.php b/core/api/v1/api.php
@@ -74,7 +74,7 @@ function authenticate(\Slim\Route $route) {
* method - POST
* params - name, email, password
*/
-$app->post('/register', function() use ($app) {
+$app->post('/api/v1/register', function() use ($app) {
try {
$obj->thisMightThrowException();
} catch(Exception $e) {
@@ -118,7 +118,7 @@ $app->post('/register', function() use ($app) {
* method - POST
* params - email, password
*/
-$app->post('/login', function() use ($app) {
+$app->post('/api/v1/login', function() use ($app) {
// check for required params
verifyRequiredParams(array('email', 'password'));
@@ -162,7 +162,7 @@ $app->post('/login', function() use ($app) {
* method GET
* url /tasks
*/
-$app->get('/tasks', 'authenticate', function() {
+$app->get('/api/v1/tasks', 'authenticate', function() {
global $user_id;
$response = array();
$db = new DbHandler();
@@ -192,7 +192,7 @@ $app->get('/tasks', 'authenticate', function() {
* url /tasks/:id
* Will return 404 if the task doesn't belongs to user
*/
-$app->get('/tasks/:id', 'authenticate', function($task_id) {
+$app->get('/api/v1/tasks/:id', 'authenticate', function($task_id) {
global $user_id;
$response = array();
$db = new DbHandler();
@@ -220,7 +220,7 @@ $app->get('/tasks/:id', 'authenticate', function($task_id) {
* params - name
* url - /tasks/
*/
-$app->post('/tasks', 'authenticate', function() use ($app) {
+$app->post('/api/v1/tasks', 'authenticate', function() use ($app) {
// check for required params
verifyRequiredParams(array('task'));
@@ -251,7 +251,7 @@ $app->post('/tasks', 'authenticate', function() use ($app) {
* params task, status
* url - /tasks/:id
*/
-$app->put('/tasks/:id', 'authenticate', function($task_id) use($app) {
+$app->put('/api/v1/tasks/:id', 'authenticate', function($task_id) use($app) {
// check for required params
verifyRequiredParams(array('task', 'status'));
@@ -281,7 +281,7 @@ $app->put('/tasks/:id', 'authenticate', function($task_id) use($app) {
* method DELETE
* url /tasks
*/
-$app->delete('/tasks/:id', 'authenticate', function($task_id) use($app) {
+$app->delete('/api/v1/tasks/:id', 'authenticate', function($task_id) use($app) {
global $user_id;
$db = new DbHandler();