micromata / http-fake-backend

Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
MIT License
311 stars 22 forks source link

Only getting response for GET Method #20

Closed kaustavbasu075 closed 5 years ago

kaustavbasu075 commented 5 years ago

I am not able to get a response for a PUT method.I get the below {"statusCode":405,"error":"Method Not Allowed","message":"Method Not Allowed"} I get this for the default put example provided too.Could you please help me out with this.I might be missing something.

krnlde commented 5 years ago

Did you do it as described in the advanced example?

mischah commented 5 years ago

Can’t reproduce this with Node 8.9.1.

This works:

https://github.com/micromata/http-fake-backend/blob/6f77e92e0ec6b8019a1118202d5eef097af1ac5a/server/api/anotherExample.js#L1-L27

As well as

'use strict';

const SetupEndpoint = require('./setup/');

module.exports = SetupEndpoint({
    name: 'simpleExample',
    urls: [{
        requests: [
            {
                method: 'PUT',
                response: '/response-files/simpleExample.json'
            }
        ]
    }]
});

Sorry, I currently have no idea what you might be missing.