1.0.7 • Published 7 years ago

dolt-server v1.0.7

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

dolt-server

a simple server for mocking test data

https://circleci.com/gh/austinwulf/dolt-server.png

dolt-server is a tiny node module intended to allow developers to mock server responses for integration tests. You can start a server at a given port and mock any endpoint with a specific response.

It accepts all cross-origin requests so please don't use it for anything that needs to be secure. This is not fully featured and I totally hacked it together for work, but feel free to use it for your purposes and contribute or open issues.

Getting Started

dolt-server can be installed through NPM: npm install --save-dev dolt-server

API Reference

const doltserver = require('dolt-server')

// start the server at a given port
doltserver.start(3000)

// mock an endpoint
doltserver.mock({
  /* Supported methods: GET, POST, PUT, DELETE */
  method: 'GET',

  /* All URLs are `http://localhost:PORT/${path}` */
  path: '/',

  /* Response can be a string, number, array, or object */
  response: { message: 'Hello world!' }
})

// stop the server
doltserver.stop()
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago