![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
A plugin-based tool for running fake HTTP and socket services.
frock is a tool for running fake services and serving mock data. It's designed for developers who work in service-oriented architectures, and need to stand up fake services that approximate production services in their development environments.
frock itself is a host for running HTTP and socket services, and its HTTP router makes it simple to run multiple services on the same port. Outside of the core functions of starting services and routing to handlers, frock's functionality is implemented through plugins and middleware that you write.
There are some generic plugins provided for out-of-the-box functionality:
For a quick overview of the functionality frock provides, see the example in this README.
frock is a Node.js CLI utility, which loads a frockfile from your project directory. In the following example, we'll create a service that proxies requests to your local development server at http://localhost:8052, but intercepts some URLs to serve static content from a variety of sources.
In your working directory, create a frockfile.json
:
{
"servers": [
{
"port": 8080,
"routes": [
{
"path": "/api/segments",
"methods": ["GET"],
"handler": "frock-static",
"options": {
"file": "fixtures/static/segments.json",
"contentType": "application/json"
}
},
{
"path": "/api/remote",
"methods": ["GET"],
"handler": "frock-static",
"options": {
"url": "http://raw.githubusercontent.com/somewhere/something.json",
"contentType": "application/json"
}
},
{
"path": "*",
"methods": "any",
"handler": "frock-proxy",
"options": {
"url": "http://localhost:8052"
}
}
]
}
]
}
Install frock and the plugins you requested:
$ npm install frock frock-static frock-proxy
Then, run frock:
$ frock
This examples expects that your PATH
is set to run Node.js packages from your
project's installed node_modules
; see the Understanding Packages
section of the documentation for details.
Note: By default, frock only allows connections from localhost
; see the
docs on connection filtering for details.
frock's documentation is split into several sections:
frockfile.json
The frock
command will search upward from your current directory for a
frockfile.json
, and run it; it will also start up a watcher on that file and
hot-reload on any changes made to it.
Use the built-in help to learn about other options:
$ frock --help
Some options can be set via environment variables; these provide defaults, which
can still be overridden by explicitly passing CLI flags. Set these to any value
besides an empty string to set the default to true
:
FROCK_NO_WATCH
disable watching the frockfile to reload changesFROCK_DEBUG
set the log level to debug
FROCK_RAW_OUTPUT
output the raw log JSON rather than pretty-printingFROCK_UNSAFE_DISABLE_CONNECTION_FILTERING
disable processing of
whitelists/blacklists for connections, and allow any incoming connectionsFrom the project directory:
$ npm test
Any test file that should be run must be required in the tests/index.js
file.
Apache 2.0, see LICENSE for details.
[2.0.0]
package.json
FAQs
A plugin-based tool for running fake HTTP and socket services.
The npm package frock receives a total of 99 weekly downloads. As such, frock popularity was classified as not popular.
We found that frock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.