Drosse
A stateful and programmable mock server
Drosse is a web server written in javascript that focuses on mocking APIs in frontend projects.
Unlike other similar tools that only serve static content, Drosse can serve dynamic content and ships with an internal in-memory database, allowing developers to modify and persist data.
RESTful in peace
Drosse has been built to be the go to web server for frontend development. It’s designed to meet every possible use case developers might encounter.
Lightweight
Drosse is as light as a nodejs process can be.
Install it as an npm
dev dependency to your project or gloablly (or run it via docker…)
Tight to your project
Your mocks come with you and so does the app that serves them.
You can launch your backend in the same npm
command as your frontend app.
Cascading config
Route definitions and plugins (throttle, proxy, etc.) are written in a single JSON file in a tree structure. Inherit plugin configs from parent route, or overwrite them, it’s that simple!
Fully extensible
Need session management, jwt auth or consume a 3rd party API at runtime? Drosse is compatible with express middlewares. Use its built-in ones or write your own(s)!
Data persistence
Drosse ships with a fully integrated document database accessible through a super easy-to-use API. for advanced querying you can always use the built-in mongo-like syntax.
🤓 Hackers compatible
Extensible REPL CLI, scraping mode, chainable proxying… Wanna go hard on tweaking? Be our guest!
Use cases / Testimonials
Full microservice API simulation
We needed to simulate a full microservice backend in javascript with mocked/anonymized data, including user login/session, helpdesk/3rd party system simulation so we built Drosse to manage all that…
Testing a chat widget integration
I had to mock a chat module backend to test its frontend widget tracking integration.
Drosse let me do that in less than 5 minutes.
Replace bloated mocking tool
I mocked missing endpoints on top of an existing complex mock server. The new endpoints were done in no time with Drosse while the rest of the API fell back on the other mock server.
Some weeks later, the bloated mocking solution was dropped in favor of Drosse… 🤷
Connect the dots
I had this next.js app that I wanted to connect to my local sitecore backend API running on HTTPS with a self-signed certificate and could not figure out how to have next.js’s proxy disable SSL checking.
After 30 minutes of unsuccessful attempts, I
npm install
-ed drosse and got it working in split seconds…What else? ☕
Trick CMS form validation
I had to hook into Sitecore’s 😡 jQuery form validation from my Vue.js app without any access to the Sitecore instance.
I was about to throw myself through the window when I thought maybe Drosse could help me solve that issue.
I copied the jQuery scripts into a static folder served by Drosse and added a route for the form submission (POST) and voilà!
Thank you Drosse’s authors to make my life easier!
E2E state management
Drosse helped me bind my SPA to an e2e testing tool to reset state automatically (through custom user defined commands) before running my test scenarios and ensure the tests always run against the same backend state.
The goal here was to use only one set of mock for both local development and e2e testing.
Goal achieved, huge gain of time, more time to spend with my daughter (if I had one…) 😂
Data edition with moderation
I wanted to mock the edition of person address data. But the changes must not applied directly ⏤ they are delayed for further control and validation.
With Drosse and its built-in database, it’s possible to handle that. And it’s even possible, with the advanced CLI feature to create a script that will apply the person modifications by simply calling a custom command in the terminal.
Drosse saved my entire life ❤️ 🙏