Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.