Closed dcp3450 closed 9 years ago
does your implementation looks like this ?
add_action('slim_mapping',function($slim){
$slim->get('/nano/api/books/:id',function($bookId){
echo $bookId;
});
});
how is your wordpress installed ? in a sub folder ?
Turns out it was the piece you pointed out. I figured it out right after I posted this. The instructions say, this:
add_action('slim_mapping',function($slim){
$slim->get('/site/api/user/:u',function($user){
printf("User is %s",$user);
});
});
but it doesn't say that if you change the default on the settings page you need to update the above code manually. That was my confusion.
Is good it's working now :)
I have the plugin installed in the correct spot, I've changed the settings for the plugin to
nano/api/
, and I'm using/%postname%/
, for the permalinks. I'm running locally via MAMP. I created a test plugin to play with Slim:I'm getting the Slim 404 when I pass
localhost/nano/api/books/12
. I'm hoping to get "book" back. The idea, once I get working is to return json. Right now I just want to return something with my get calls instead of getting the Slim 404 page (I know it's not the WP 404).