sideshowcoder / canned

Server to respond with fake API responses, by using a directory of files for finding out what to say!
213 stars 46 forks source link

improve getting started docs #20

Open sideshowcoder opened 10 years ago

sideshowcoder commented 10 years ago

@mulderp pointed out rightfully that the getting started is located rather awkward at the middle if the docs. I think to move it to the top would be great as long as their is a small example in there which explains more then just how to start canned but includes a simple one file setup maybe?

mulderp commented 10 years ago

Yes, my favorite example domain would be about "movies", e.g. show how a single movie is retrieved, and maybe how a new movie could be written to an API.

sideshowcoder commented 10 years ago

Sounds good if you care to write something up would be great!

mulderp commented 10 years ago

Hm, not sure why I got "not found":

In the project directory, I do:

bin/canned example
starting canned on port 3000 for example

The, I do requests with Curl with:

pmu:blog(master|533m) pmu$ curl 0.0.0.0:3000/_search
pmu:blog(master|590m) pmu$ curl 0.0.0.0:3000/example/_search
pmu:blog(master|591m) pmu$ curl 0.0.0.0:3000/example/comment/1

But they all seem to result in:

request: get /example/_search not found
request: get /example/comment/1 not found

Any idea what I am missing here?

sideshowcoder commented 10 years ago

Ok a couple of things, that should be made clearer for sure: to reach _search.get.json one would call curl http://localhost:3000/search the _ is just an indicator that this is not a "special file" but the name should be use "as is" also the naming in the example. For the id.get.json this is just a leftover from the original plan to use id as the keyword, it is actually any.