Coder Social home page Coder Social logo

justinwoo / ember-cli-api-stub-static Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 176 KB

ember-cli add-on for serving out static JSON files as "endpoints" along with the static files served

Home Page: https://www.npmjs.org/package/ember-cli-api-stub-static

JavaScript 100.00%

ember-cli-api-stub-static's Introduction

ember-cli-api-stub-static's People

Contributors

justinwoo avatar unwiredbrain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

unwiredbrain

ember-cli-api-stub-static's Issues

Interesting..

I've been trying to figure out a way to use a static folder of pre-canned json api responses essentially as a spec for an application - something that can be used to test

I've been searching for something that can be used to serve ember pre-canned json for GET and POST requests, and preferably that thing also has a server mode that can fire requests to the live backend and validate they match what's expected in the folder of pre-canned json.

So there would be this testjson folder, essentially providing front and back end teams a spec for what the json api should be. Here's my current idea for what that folder would look like:

testjson/
  /todo
    /0 -> a file with no extension and just an example json response
    /1 -> another json object for another todo
  /todos -> another json file, an array consisting of todos 0 and 1
  /todos/new -> responds to POST request with a new todo (doesn't necessarily have to have ID 2)

Essentially it's just a different take on fixture data - the idea is you would just keep it in it's own folder and it can be used for unit testing of the client and server side. I'm not sure it would lend itself very well to integration testing. I feel like something for testing API's already exists in some form.

Cannot POST /...

This is a helpful alternative to api-stub, for CLI, but I have an action which POSTs some search criteria (JSON) at a URL and for this I get "404 Not Found" and "Cannot POST". I have response JSON setup up in "../server/routes", and can "GET" the JSON, but why won't it also work with a POST method?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.