Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
modern-mirror
Advanced tools
A simple server that makes mocking production servers more feasible
There have been multiple times in my development career where I've just needed something to serve a very specific response. Usually because the actual server I'd be requesting from doesn't have a sandbox, or it is currently unavailble for a variety of reasons. Enter Modern Mirror. Modern Mirror let's you quickly "Mock" a server by dropping files in a directory that contain the content you want to be returned.
npm install -g modern-mirror
To start the server run modern-mirror
Modern Mirror accepts the following arguments:
-p --port
the port that Modern Mirror should run on (defaults to 3000
)-d --route-directory
the directory that Modern Mirror should use for its routes (defaults to ~/modern-mirror-routes
)modern-mirror
test.json
in the ~/modern-mirror-routes/
directory or whatever directory you specified with -d
/--route-directory
localhost:3000/test
test.json
file you created earlierProper REST apis don't operate right off of the domain. Most urls will look like this: localhost:3000/api/customers/1?firstName=hesto2
. To support this kind of url, you will need to do the following:
api
api
folder, create another folder titled customers
1.json
, or if you wanted to be more specific you can do 1?firstName=hesto2.json
If you don't want to include the query params in the file name, Modern Mirror will return the content of the first file matching customer*
. Having the query params in the file name will allow you to return different responses if your app makes requests with varying params.
FAQs
A simple server that makes mocking production servers more feasible
We found that modern-mirror demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.