mock-responses
TypeScript icon, indicating that this package has built-in type declarations

3.7.9 • Public • Published

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'
  ]
};

Package Sidebar

Install

npm i mock-responses

Weekly Downloads

7

Version

3.7.9

License

MIT

Unpacked Size

43.6 MB

Total Files

1811

Last publish

Collaborators

  • allenkim
  • allenhwkim
  • karanpreet
  • monica.kochofar