Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Drew Dara-Abrams
    @drewda
    thanks, @basicallydan! I'll try again, following your instructions, and let you know if it works
    Daniel Hough
    @basicallydan
    No problem @drewda, happy to help!
    dmart120
    @dmart120
    Hi, interfake has been very useful so far in mocking out an API where the backend is not yet completed. I'm trying to figure out why cross origin requests to interfake are not working? it looks like it should support cross origin requests?
    Daniel Hough
    @basicallydan
    Hey @dmart120 glad you're finding it useful. It should do, yeah. It does wildcard CORS out of the box. Are you finding the Access-Control-Allow-Origin header is not set when responses come back?
    dmart120
    @dmart120
    i don't get any responses at all. chrome shows the request method as OPTIONS, but the request header has Access-Control-Request-Method:GET. i'm not sure why chrome says the request method is OPTIONS?
    dmart120
    @dmart120
    @basicallydan
    Daniel Hough
    @basicallydan
    Hey @dmart120 sorry I totally missed your messages!
    Lemme have a look at lunch, see if anything has changed
    dmart120
    @dmart120
    @basicallydan thanks! let me know if you find anything
    Daniel Hough
    @basicallydan
    I think I know why this is happening. Interfake accepts requests wildcard for method and path, so the OPTIONS request that chrome is probably making beforehand is being returned as the default, which is GET. Someone opened an issue relating to OPTIONS not being supported, and has offered to fix it, which should also solve this problem :)
    Daniel Hough
    @basicallydan
    @dmart120 Is your version of Interfake up-to-date?
    Because OPTIONS requests actually don't seem to work at all, which now makes sense
    ddperdue
    @ddperdue
    @basicallydan Hello, I've been having trouble getting serveStatic to work. I basically copy and pasted the example code in, but I'm always getting a 404 response when I visit localhost:3000/static/index.html . The html file is in the same folder as my interfake code. Everything is working when I use the interfake.get().body() type examples but the serveStatic doesn't work for me. Any thoughts on why this would not be working? Thanks for any help you can provide.
    Jon Denly
    @jdenly
    @ddperdue I had a similar issue when I was trying to mix together serveStatic and other mappings at the same time. The solution I found was to separate out the first part of the URL to make sure there was no overlap between the static mappings and the non-static, otherwise interfake was trying to find the static mapping in the normal routes.
    // Have to provide a path so it doesn't clash with the static serving.
    var interfake = new Interfake({path: '/api'});
    interfake.serveStatic('/static', './');
    Todd Pickell
    @tapickell
    Hey, was wondering if there is a way to output the json payload received from a POST request with interfake?
    Was thinking of using this as a simple way to make some assertions against the response.
    Daniel Hough
    @basicallydan
    Not built in, no, but I've received this request before. Might be an easy feature to do... Could just be like .post('/thing').echo(), how does that sound?
    @jdenly, having problems with servestatic for a while
    Been meaning to fix but have been on holiday, I was hoping to fix it today :)
    Sorry about the delay
    I'll let you know how I get on
    Daniel Hough
    @basicallydan
    Alright @ddperdue and @jdenly I have fixed servestatic... https://github.com/basicallydan/interfake
    Give it a go
    Update to 1.14.0
    Daniel Hough
    @basicallydan
    @myappleguy Implemented that feature request, check out 1.15.0 :)
    Use .echo, it'll work.
    or echo : true in the response object
    Todd Pickell
    @tapickell
    Nice, thats awesome. Thank you @basicallydan
    Todd Pickell
    @tapickell
    @basicallydan just tested new version, that is exactly what I needed, thank you. :D
    Jon Denly
    @jdenly
    @basicallydan Thanks, I'll give the servestatic changes a go.
    Daniel Hough
    @basicallydan
    👍👍