New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mock-responses

Package Overview
Dependencies
Maintainers
4
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-responses

espress-kind http request middleware

  • 3.7.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-93.7%
Maintainers
4
Weekly downloads
 
Created
Source

mock-responses

NOT-real API server for front-end development Introduction

Start server(NestJS) for production

$ cd server 
$ npm i
$ npm run build
$ cd dist/server && node main.js

For development

$ npm i
$ npm start
# cd server && npm run start:server # to start server(NestJS) separately
# or cd client && npm run start:client # to start clien(Angular9) separately

Configuration File

Update mock-responses.config.js for detailed setup.

  • dbPath: required, mock-responses .sql file (get this from demo)
  • ssl: optional, false in default. If true, the server starts in ssl mode.
  • sslKeyPath: optional, ssl key file path. If not defined, it uses a defaul key file.
  • sslCertPath: optional, ssl dert. file path. If not defined, it uses a defaul cert file.
  • port: optional, default 3331. port number for server
  • cookie: optional, sring. if set, all mock responses reply with this cookie.
  • headers: optional, array, if set, all mock resonses reply with this headers.
module.exports = {
  dbPath: './mock-server/mock-responses.sql',
  ssl: true,
  port: 9200,
  cookie: 'MY_SESSION=ACCTNBR=123456789; Path=/',
  headers: [
    'Access-Control-Allow-Headers=Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With'
  ]
};

Keywords

FAQs

Package last updated on 25 Nov 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc