smollweide / node-mock-server

File based Node REST API mock server
MIT License
255 stars 65 forks source link

Allow to specify HTTP response code for success responses #92

Closed BTMPL closed 6 years ago

BTMPL commented 6 years ago

This PR adds the option to specify a HTTP status code to success responses as well if so desired. It will check if the file name ends in 3 digits, and if so use those so both success-201.json and success-example-201.json will be valid.

Not sure if this is needed for _sendSuccessNotJSON and _sendSuccessJSON options.res.send(responseFile); case.

smollweide commented 6 years ago

Hi @BTMPL, I added the custom statusCode also for static content 2bdb733 merged and published in v0.22.0

thanks 👍