Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
The npm package modern-mirror receives a total of 1 weekly downloads. As such, modern-mirror popularity was classified as not popular.
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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.