Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
apollo-mock-server
Advanced tools
A mock server of Ctrip's apollo configuration service.
This is a mock server only for testing, so it barely has any argument type checking and fault tolerance.
$ npm i apollo-mock-server
const {ConfigService} = require('apollo-mock-server')
require('http').createServer(
new ConfigService({
pollingTimeout: 3000
}).callback()
)
.listen(8888)
Object
number=60000
If there is no update notifications in options.pollingTimeout
milliseconds, then config service will tell the client with status 304
Return a callback function suitable for the http.createServer() method to handle a request.
number
port to listenListen to a port. If port
is not specified, it will get an available port by using get-port
Returns a promise of the port
used
config.listen()
.then(port => {
console.log(`server started at http://127.0.0.1:${port}`)
})
Enable or disable the API of get configurations, including both:
/configs
/configfiles
If disabled, the two APIs will both response with status 404
If enabled, the two APIs above will response a bad JSON string
If disabled, the API /notifications/v2
will response with status 404
The admin client for super user
const {superAdmin} = require('apollo-mock-server')
superAdmin
.app('my-application')
.cluster('default')
.namespace('application')
// Changes the config value
.set('portal.elastic.cluster.name', 'hermes-es-jp')
// Emit update notifications
.publish()
FAQs
A mock server of Ctrip's apollo configuration service
The npm package apollo-mock-server receives a total of 3 weekly downloads. As such, apollo-mock-server popularity was classified as not popular.
We found that apollo-mock-server 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.