
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
A Ruby HTTP Mock Server based on Sinatra. JSON responses.
Features:
gem install http-mock-server
http-mock-server
Only one option: the config yaml file to use
Example: http-mock-server conf.yml
Config file can also be passed setting ENV['MOCK_CONFIG']
environment variable.
---
config:
namespace: '/api/v1' # prepend to every route
# no_cors: true # don't send CORS headers
port: 8080 # server port
# timeout: 10 # response timeout
verbose: true # shows request params
not_found:
body:
message: This is not the path you are looking for...
routes:
-
get: '/posts'
headers:
'A-Random-Header': Something
body:
message: List of posts
-
get: '/posts/:id'
body:
content: 'A random number #{rand} !'
extra:
today: 'Today is #{DateTime.now}'
request: 'Post id #{params[:id]} - request path #{request.path}'
more:
is_first: "conditional check #{params[:id] == '1' ? 'first' : 'other'}"
an_array:
- me
- myself
- I
an_array2:
-
name: me
age: 20
-
name: myself
age: 30
-
name: I
age: 40
-
get: '/pry'
body:
message: '#{binding.pry}'
-
post: '/posts'
status: 201
body:
code: 201
result: Ok
-
delete: '*'
status: 405
body:
message: Please don't do it
-
options: '*'
status: 200
headers:
'Access-Control-Allow-Origin': '*'
'Access-Control-Allow-Methods': 'HEAD,GET,PUT,DELETE,OPTIONS'
'Access-Control-Allow-Headers': 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Cache-Control, Accept'
'Access-Control-Expose-Headers': 'X-Total-Count'
See docs for Sinatra request variables.
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
FAQs
Unknown package
We found that http-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
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.