GithubHelp home page GithubHelp logo

staticdeploy / mock-server Goto Github PK

View Code? Open in Web Editor NEW
34.0 5.0 4.0 3.6 MB

Easy to use, no frills http mock server

License: MIT License

JavaScript 99.02% Dockerfile 0.98%
mock-server frontend tooling

mock-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mock-server's Issues

Handle json schema validation

mock-server has not validation on calls that receive.

With #6, it will only validate that the endpoints exists, but could be useful if it validates the parameters

Using middleware

Is there a current way to use Express middleware? For example, .use(express.static(resolve(options.root, '../dist/scripts')))? This is just an example, but curious how to add arbitrary middleware.

Fix docs name

Rename docs/why-use-sd-mock-server.md -> docs/why-use-mock-server.md

Collect metrics of API calls

Collect which APIs have been called (and how many times they were called).

When the mock server stops, print a list of all APIs and their metrics, so it's possible to see if there are APIs which have not been called (and potentially remove them).

NPM Registry

The looks like a good library. Any reason it is not released to the NPM Registry?

Set a delay for a specific route

It could be interesting to enable a delay only to a specific route to increase the loading phase of an api call.

Now we could add a setTimeout function to wrap the response.
An interesting improvement could be set a property to the response adding a timeout.

An example to delay the response for 4s could be:

module.exports = function (req, res) {
    res.status(200).delay(4000).send({})
}

Load routes from npm package

Instead of specifying a root directory, allow specifying (option --from?) the name of a npm package that exports a mock-server. For an npm package to export a mock-server means to have a folder mock-server containing routes.

Dependency issue

In new version, @staticdeploy/app-config package is required but is only in dev-dependencies, so it is not installed

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.