A developer friendly mock server with GUI, Traffic Capturing and with many more features. This gives boost in your front-end development without any actual production server.
- Download the
onemock-v1.1.jar
build file from the latest release, click here to download.
Start the Server
java -jar onemock-v1.1.jar
Default port is 8080
Start the Server with custom port
java -jar -Dserver.port=9001 onemock-v1.1.jar
- Create mocks with more than one responses from a single endpoint.
- Traffic can be captured from your application for a better analysis.
- User friendly GUI to configure everything without a single line of code.
- SQLiteDB and Java allows the mocks and capture history portable across the machines.
To run the server, you will need to install the following in your machine.
Java
Access the dashboard at http://localhost:8080/home
from any browser.
To use the mock server in any front-end code put the base url as http://localhost:8080/onemock
and append the rest of the path to this.
For Example
const base_url = "http://localhost:8080/onemock";
let fetchRes = fetch(base_url + "/todos/1");
fetchRes
.then((res) => res.json())
.then((data) => {
console.log(data);
});
- At present only supported formats for request body are
plain/text
application/json
application/xml
Dashboard: React, TailwindCSS
Server: Spring Boot, SQLite DB
If you have any feedback, please reach out to me at harshavardhan.gadireddy@gmail.com