Install Restler on Windows / Xampp

i'm trying to run restler on windows, in combination with Xampp.

so i finnaly finished to unzip the files with composer, my htdocs directory looks like this, where the folder API is my restler directory: c:xampphtdocsapi * here are the restler files located* (can't post an image - no reputation)

So how do i get my application running? The restler tutorial shows me how i should do this.... .. here a Link for the Restler Installation tutorial .. and here an excerpt from it:

Update the base_url specified in behat.yml and then try the following command

bin/behat

so this is the point i am confused: where do i have to run the command, in the CMD in Windows, it doesn't work (of course i went to my API directory)

as you can see, this topic is fairly new to me, so please, i need something i can understand. This is my first REST API BACKEND. What REST is and how i can use it from my fronend is clear to me. PHP itself is also no problem.

Thanks so much.

I also looked here on StackOverflow for a solution, but only found this, which won't get me further on my problem. i found this here


SOLVED!!

Here are my results, for all who get the same problem.

It's really easy, my fault was, i saw evrything too complicated, here is my aproach:

Step 1: I highly recommend to try one of the examples first. Luckily, there are many examples which come with restler, right out of the box. FIRST: ONLY USE THE /PUBLIC Folder for your app. !!THIS WAS MY FAULT!!!

Step 2: Try one of the examples... try to make a GET with curl, on the Windows Console, for one of the examples, here fpr the Hello world.

curl -X GET http://localhost:8009/api/public/examples/_001_helloworld/say/hello
"Hello world!"

Thanks to all of you! :]


While browsing the restler installation site linked by you above in the question I just came over the Quick Start Guide section, where there was this snippet.

Create is as index.php in your App directory.

<?php
require_once '../../../vendor/restler.php';
use LuracastRestlerRestler;

$r = new Restler();
$r->addAPIClass('YourApiClassNameHere'); // repeat for more
$r->handle(); //serve the response
//...
?>

You need first Require the restler.php (Adjust the includes to your needs) then use the Namespace (Or dont if you dont want, but then you have to specify while objekt instantiation). Next you create a Restler Object and add your API classes, finally you call the handle() method on the Restler Object.

You can browse the URL relative to your htdocs. Check below the Quickstart Guide on the install guide for using mod_rewrite to use pretty URLs.

链接地址: http://www.djcxy.com/p/66092.html

上一篇: Windows屏幕保护程序安装位置

下一篇: 在Windows / Xampp上安装Restler