Git Product home page Git Product logo

mockoon / mockoon Goto Github PK

View Code? Open in Web Editor NEW
5.9K 62.0 330.0 24.83 MB

Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.

Home Page: https://mockoon.com

License: Other

TypeScript 87.58% JavaScript 1.81% HTML 9.60% Dockerfile 0.07% Shell 0.04% SCSS 0.90% Batchfile 0.01%
mock server rest-api rest application electron desktop api prototyping swagger

mockoon's Introduction




Mockoon: awesome API mocking

Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, free and open-source.

It's a desktop application and a CLI that help you work faster with APIs by mocking them. Integrate third-party APIs quicker, improve your integration tests, speed up your development, etc.

➡️ Download

Features

Mockoon offers many features:

  • unlimited number of mock local servers and routes
  • CLI to run your mock in headless environments, CI, etc.
  • complete control on routes definition: HTTP methods and statuses, regex paths, file serving, custom headers, etc.
  • OpenAPI compatibility
  • Record/logs of all entering and forwarded requests
  • JSON templating
  • proxy forwarding mode
  • HTTPS support

You can check the complete list on the website.


Our sponsors

Platinum

GitHub logo         Localazy logo         Peakcrypto logo

Silver

Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the Sponsors and Backers who helped this project over time!

sponsor button

Download the desktop application

You can get Mockoon desktop's latest release directly from this repository or on the official website. Mockoon desktop is also available through:

MacOS:

  • Homebrew: brew install --cask mockoon.

Windows:

Linux:

Install the CLI

Mockoon CLI is available as an NPM package. Please check our dedicated documentation to learn how to install and use it.

Use in cloud functions and serverless environments

Mockoon's Serverless NPM package provides an easy way to run Mockoon's mock APIs in cloud functions and serverless environments: AWS Lambda, GCP Functions, Firebase Functions, etc.

Please check our dedicated documentation to learn how to use it.

Subscribe to Mockoon Pro

With advanced features for solo developers and teams, Mockoon Pro supercharges your API development:

Upgrade today and take your API development to the next level.

pro button

Mockoon's documentation

You will find Mockoon's documentation on the official website. It covers Mockoon's most complex features. Feel free to contribute or ask for new topics to be covered.

Changelogs

You will find Mockoon applications changelogs on the official website.

Support/feedback

You can discuss all things related to Mockoon, and ask for help, on the official community. It's also a good place to discuss bugs and feature requests before opening an issue on this repository. For more chat-like discussions, you can also join our Discord server.

Contributing

If you are interested in contributing to Mockoon, please take a look at the contributing guidelines.

Please also take a look at our Code of Conduct.

Roadmap

If you want to know what will be coming in the next release you can check the global Roadmap.

New releases will be announced on Mockoon's Twitter account @GetMockoon and through the newsletter to which you can subscribe here.

mockoon's People

Contributors

255kb avatar abiodunjames avatar ajatkj avatar axc450 avatar barefootdeveloper avatar codingcircus avatar dependabot[bot] avatar edtoken avatar gabrielperes97 avatar gamedevtutorials avatar gerwazy102 avatar hugo-carbiener avatar isuru89 avatar izerozlu avatar jerantony avatar joshmleslie avatar lukefx avatar m-roberts avatar martin-bucinskas avatar mathilde-lannes avatar mavbraz avatar mivanov avatar ninjaneer164 avatar nrdobie avatar phloose avatar pierredup avatar sleepypikachu avatar sotcha avatar spissable avatar thanakorn-ki avatar

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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mockoon's Issues

Add Query Parameter in URL

Hi,
I want to mock the URL with query parameter like

/wp-json/wp/v2/categories?per_page=50

its throwing error:
Cannot GET /wp-json/wp/v2/categories

When I save the URL without query parameter eg:

/wp-json/wp/v2/categories

then its working fine.

Pls, help to store URL with a query parameter.

Thnaks in advanced.

Add support for 'oneOf' and 'someOf' to body templates

The dynamic body templating is already pretty awesome, but it would be even better if you could add support for 'oneOf' and 'someOf'.

The 'someOf' picks one or more items from any given array, with optional parameters defining the minimum and maximum amount of items to be picked, returning an array with the picked items.

"type": "{{someOf ["apple", "banana", "cherry", "orange"] 1 3}}"

The 'oneOf' picks one single item from an array and returns the item.

"type": "{{oneOf ["small", "medium", "large"]}}"

Make custom headers and CORS headers compatible

Avoid CORS headers overriding custom headers, or merge them.
Especially this one:
Access-Control-Allow-Headers: Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With

Proxy recording / snapshotting

It would be wonderful if I can configure a url, and proxify all calls from a mockoon server to that other server.
Then the mockoon server would replay what it recorded as pairs of requests/responses, like mountebank.

Use case?

  • I developed an API and I have to mock it for a frontend team afterwards.
  • I mocked an API, but it changed, so I want a way to retrofit mockoon fast.

Cursor automatically jumps to the end of the url when editing

Describe the bug
When editing somewhere in the url, the cursor automatically jumps to the end of the url. I had to reposition my cursor every time.

To Reproduce
Steps to reproduce the behavior:

  1. Go to route editing panel
  2. Click on somewhere in url input box(endpoint)
  3. Input one character
  4. See the cursor jumps to the end

Expected behavior
The cursor moves normally.

Screenshots

Desktop (please complete the following information):

  • OS: [MacOS 10.13.4]
  • Browser: [Chrome]
  • Version [v0.4.0 beta]

Proxy absent routes

We should be able to setup route to proxy to a real api.

ie:

In mockoon we setup GET: localhost:3000/get/url will be proxied to GET: https://www.google.com/get/url

That way we can mock only SOME endpoints instead of an all or nothing aproach

Export request logs

Is your feature request related to a problem? Please describe.
Thank you for the logs tab feature. There is no way to export the request logs to a report/file.

Describe the solution you'd like
An option to export the request logs to a text/csv format.

Describe alternatives you've considered
Atleast a copy/paste option

Additional context

v0.3.0 beta checklist

  • Bump app version

Builds:

  • Build Windows version
  • Build Linux version
  • Build OSX version

Tests:

  • Test Windows version
  • Test Linux version
  • Test OSX version

Publish:

  • Publish Windows binaries
  • Publish Linux binaries
  • Publish OSX binaries
  • Publish update file
  • Create release on repository
  • Update website with new versions
  • Update website's feature list
  • Update Github issues
  • Spread the word!
    • Plan posts on social networks
    • Send newsletter

Slow response time

Response time for a basic response sourcing the body from a file is at least 2 seconds! Which isn't great.

I've timed a bunch of requests:

  • 1: 1157ms
  • 2: 923ms
  • 3 485ms
  • 4 631ms

Server response time should be under 200ms

My payload:

[
	{
		"title": "Hello. Today is Thursday.",
		"body": "Finally, it’s nearly the weekend - not quite yet. But we’re now over the hump-day, and have two more days to go! ",
		"key": 1,
		"submitData": "By Ozzie - Thursday, 26th of July, 2018."
	},
	{
		"title": "Long title post components?",
		"body": "This is a complex matter, I like the short and snappy title, but I will need longer titles to make it work. ",
		"key": 2,
		"submitData": "By Ozzie - Thursday, 26th of July, 2018."
	},
	{
		"title": "This just keeps getting better",
		"body": "Important posts tag. Yep, a new tag that will be sorted so that they are at the top of the page, they will be more obvious, and will get a neat litle tag saying they're important",
		"key": 3,
		"submitData": "By Ozzie - Friday, 27th of July, 2018.",
		"important": false,
		"pinned": false
	},
	{
		"title": "Wanted to end today on a high.",
		"submitData": "By Ozzie, Sunday, 19th of July, 2018",
		"body": "The implementation for sorting pinned posts away from standard ordinary posts is simple: Pull them out, delete their entry in the main object, create a new array, and then just add them onto the start once the main array has been populated. But it's a tad slow.. And I don't know why :(",
		"pinned": true,
		"important": false,
		"key": 4
	},
	{
		"title": "What's to come...",
		"submitData": "By Ozzie, Sunday, 19th of July, 2018",
		"body": "Syntax highlighting and markdown support (either that or a custom language), a rewrite of the post generation components and general tidying up of the code base. Also, while it doesn't necessarily matter, post generation is a bit slow. Not sure why, but yeah it's not as quick as it is supposed to be, though I think I can address that with the rewrite.  ",
		"pinned": false,
		"important": false,
		"key": 5
	},
	{
		"title": "Hello World",
		"submitData": "Not sure of the date, this is just a test",
		"body": "Literally, this is just a test. I think the [There's More] button is broken",
		"important": false,
		"pinned": false,
		"key": 7
	},
	{
		"title": "Nearly finished the frontend!",
		"submitData": "Thursday, 16th of August, 2018",
		"body": "**This is just a test**\n Things that I need to complete:\n\n+ Post submit page \n\n+ The backend",
		"important": false,
		"pinned": false,
		"key": 8
	}
]

HTTPS Support

Maybe mockoon could provide its own certificate or let the user provide them ?

Support overriding Content-Type header

Describe the bug
Content-Type header is currently chosen from a drop down which makes it limited in options. If it is defined again in the headers section, give priority to the custom value over the pre-defined drop down option.

To Reproduce
Steps to reproduce the behavior:

  1. Define any http request and response
  2. Add the header Content-Type with any value in the Headers section of response.
  3. Start the mock server
  4. Invoke the configured request from any HTTP client.
  5. See that the custom header does not appear in the response

Expected behavior
Content-Type header configured in the Headers section of response should be given priority.

Screenshots
NA - simple to reproduce

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Version: any

Insert Array in header

i'm trying to make mockoon answer to an URL which contains an array in the header:

url?date=2018-05-06&actors=RIRI&actors=FIFI&actors=LOULOU
this might already be possible but i can't seem to find how in the doc or make it work myself

capture
this is what i tried so far

This is a very coonvenient app, great job by the way

UI Theming / Light colors

Is it possible to add light UI colors (or some way to define colors)? It's difficult to read: it's too dark.

Save environment as JSON

Please add possibility to save your environment into JSON file(maby with other file type but with json structure inside, with that feature we can use "Open In..." select Mockoon by default to open environment file, it will be very-very-very useful feature), it will be a great feature if i want to save my environment in project repository and use it on other development machines

I really want to help you to improve this app, if you need some help, please write me😅 I can try to implement this functionality if you open sources for me or something like that

Request: Be explicit about the analytic data collected

The FAQ currently states

Yes, but only anonymous data through Google Analytics, with
some very basic metrics like: number of environments and routes
you have, actions done in the application (route select, server started, etc).

Suggest showing an example (of all possible collected data) in-line or directly linking to an example submission.

When talking about being tracked, both commercial and residential users must be wary of ambiguity.

[Poll] Add more import / export formats

Please vote below with reactions (👍) for import / export formats you would like most to see in Mockoon. You can also comment to add other formats.
Please keep this issue clean by using emojis and avoiding commenting too much.

OSX: Cannot listen on ports < 1024

Even when running the app in privileged mode , it will not allow you to specify ports less than 1024 as the listening port. Being able to use 443 or 80 are pretty important for us as we can't always easily change our clients to test on different ports.

Provide a log of requests

It would be useful to have a log of API requests that have been received when debugging integrations.

Ability to order routes by dragging a route up or down

Mockoon supports a "/*" route that will handle all requests that were not previously routed, which is awesome, however you have to put this route at the end. Otherwise it will prevents subsequent routes from getting considered. To help organize the routing strategy, it would nice if we could reorder routes by dragging them up or down.

Sending ZIP breaks the archive

Hey,

if I want to send a ZIP file I get following error when I try to unzip it:

Error: invalid central directory file header signature: 0x80014

If I test it with unzip -tq Archive.zip the output says:

error [Archive.zip]:  missing 113 bytes in zipfile
  (attempting to process anyway)
error [Archive.zip]:  start of central directory not found;
  zipfile corrupt.
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

v1.0.0 crashes on launch on Linux

Describe the bug
After downloading the AppImage from the website and attempting to run the application; after the initial integration dialog, the following output appears in the console and the application fails to launch.

module.js:472
    throw err;
    ^

Error: Cannot find module '/tmp/.mount_mockoodTGR9I/resources/electron.asar/browser/init.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:431:7)
    at startup (bootstrap_node.js:155:9)
    at bootstrap_node.js:551:3

NOTE: removing ~/.config/mockoon had no effect

To Reproduce
Steps to reproduce the behavior:

  1. Download Mockoon 1.0.0 AppImage
  2. chmod a+x the AppImage file
  3. Execute the AppImage file
  4. See error

Expected behavior
Application should launch providing mocky goodness for all

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Linux Fedora 28

Additional context
0.4.0 AppImage ran and continues to run fine.

v0.4.0 beta checklist

  • Bump app version

Builds:

  • Build and sign Windows version
  • Build Linux version
  • Build OSX version

Tests:

  • Test Windows version
  • Test Linux version
  • Test OSX version

Publish:

  • Publish Windows binaries
  • Publish Linux binaries
  • Publish OSX binaries
  • Publish update file
  • Create release on repository
  • update repo wording (open source)
  • Update website with new versions
  • Update website's feature list
  • Update website's wording for open source
  • publish website
  • move code on main repo
  • Update Github issues
  • Spread the word!
    • Plan posts on social networks
    • Send newsletter

Unable to put consecutive slashes in route path

Describe the bug
The route path does not allow consecutive (more than 1) slashes. This leads to a 404 if the route is requested with consecutive slashes in it.

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'Add route'
  2. In the path box try to type in or paste foo//bar
  3. Observe that the input box now says foo/bar (slash was removed)
  4. Start the server
  5. Using an HTTP client request http://localhost:3000/foo//bar
  6. Observe that you get a 404 Not found error instead of 200 OK.

Expected behavior
Either the server should allow routes with consecutive slashes or else transparently serve the route with the simplified path by removing consecutive slashes from incoming requests.

Desktop (please complete the following information):

  • OS: OSX
  • Version v0.4.0 beta

v1.0.0 checklist

  • Bump app version

Builds:

  • Build and sign Windows version
  • Build Linux version
  • Build OSX version

Tests:

  • Test Windows build
  • Test Linux build
  • Test OSX build

Publish:

  • Publish Windows binaries
  • Publish Linux binaries
  • Publish OSX binaries
  • Publish update file
  • Create release on repository
  • Merge website branch
  • publish website
  • merge wiki branch
  • Close / update Github issues
  • Spread the word!
    • Plan posts on social networks
    • Send newsletter

Body template enhancement

Is your feature request related to a problem? Please describe.
I may create different responses based on the input parameter from previous POST. E.g, I make a request like this: '\tag\ {id} \audience'. Then I want to create different response for each 'id'.

Describe the solution you'd like
A dynamic response template like this:

// switch({id})
'1': {audience:100},
'2': {audience:150},
'3': {audience:120}
/ switch

Describe alternatives you've considered
A random number generator is also workable. Just like this:

{
audience: // random (number:3) /random
}

It returns a random number between 100-999.
Additional context
No.

Routes with parameters

Maybe I'm doing it wrong, but I don't get how to have a route with GET URL parameters like http://localhost:3001/test?param=hello. Is this not supported?

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.